View | Details | Raw Unified | Return to issue 81497
Collapse All | Expand All

(-)unotxdoc.hxx (-1 / +1 lines)
Lines 497-503 Link Here
497
	//
497
	//
498
	void						Invalidate();
498
	void						Invalidate();
499
	void						Reactivate(SwDocShell* pNewDocShell);
499
	void						Reactivate(SwDocShell* pNewDocShell);
500
	SwXDocumentPropertyHelper * GetPropertyHelper ();
500
    SwXDocumentPropertyHelper * GetPropertyHelper() throw(::com::sun::star::uno::RuntimeException);
501
	sal_Bool 			  		IsValid() const {return bObjectValid;}
501
	sal_Bool 			  		IsValid() const {return bObjectValid;}
502
502
503
	void						InitNewDoc();
503
	void						InitNewDoc();
(-)unotxdoc.cxx (-35 / +86 lines)
Lines 472-480 Link Here
472
	}
472
	}
473
}
473
}
474
474
475
uno::Reference< document::XDocumentInfo > SAL_CALL SwXTextDocument::getDocumentInfo() throw (::uno::RuntimeException)
475
uno::Reference< document::XDocumentInfo > SAL_CALL SwXTextDocument::getDocumentInfo() throw (uno::RuntimeException)
476
{
476
{
477
	return pDocShell->GetDoc()->GetDocumentInfo()->GetInfo();
477
	if(!pDocShell->GetDoc())
478
        throw uno::RuntimeException();
479
    return pDocShell->GetDoc()->GetDocumentInfo()->GetInfo();
478
}
480
}
479
481
480
/*-- 18.12.98 11:55:08---------------------------------------------------
482
/*-- 18.12.98 11:55:08---------------------------------------------------
Lines 483-500 Link Here
483
/* -----------------18.12.98 12:49-------------------
485
/* -----------------18.12.98 12:49-------------------
484
 *
486
 *
485
 * --------------------------------------------------*/
487
 * --------------------------------------------------*/
486
SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper ()
488
SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper() throw (uno::RuntimeException)
487
{
489
{
488
	if(!xPropertyHelper.is())
490
	if(!xPropertyHelper.is())
489
	{
491
	{
492
	    if(!pDocShell->GetDoc())
493
            throw uno::RuntimeException();
490
		pPropertyHelper = new SwXDocumentPropertyHelper(*pDocShell->GetDoc());
494
		pPropertyHelper = new SwXDocumentPropertyHelper(*pDocShell->GetDoc());
491
		xPropertyHelper = (cppu::OWeakObject*)pPropertyHelper;
495
		xPropertyHelper = (cppu::OWeakObject*)pPropertyHelper;
492
	}
496
	}
493
	return pPropertyHelper;
497
	return pPropertyHelper;
494
}
498
}
495
void SwXTextDocument::GetNumberFormatter()
499
void SwXTextDocument::GetNumberFormatter() throw (uno::RuntimeException)
496
{
500
{
497
	if(IsValid())
501
	if(IsValid()&& pDocShell->GetDoc())
498
	{
502
	{
499
		if(!xNumFmtAgg.is())
503
		if(!xNumFmtAgg.is())
500
		{
504
		{
Lines 521-528 Link Here
521
525
522
			}
526
			}
523
			DBG_ASSERT(pNumFmt, "No number formatter available");
527
			DBG_ASSERT(pNumFmt, "No number formatter available");
524
			if(!pNumFmt->GetNumberFormatter())
528
			if(!pNumFmt->GetNumberFormatter()&& pDocShell->GetDoc())
529
            {
525
				pNumFmt->SetNumberFormatter(pDocShell->GetDoc()->GetNumberFormatter( sal_True ));
530
				pNumFmt->SetNumberFormatter(pDocShell->GetDoc()->GetNumberFormatter( sal_True ));
531
            }
526
		}
532
		}
527
	}
533
	}
528
}
534
}
Lines 532-538 Link Here
532
Reference< XText >  SwXTextDocument::getText(void) throw( RuntimeException )
538
Reference< XText >  SwXTextDocument::getText(void) throw( RuntimeException )
533
{
539
{
534
	::vos::OGuard aGuard(Application::GetSolarMutex());
540
	::vos::OGuard aGuard(Application::GetSolarMutex());
535
	if(!IsValid())
541
    if(!IsValid()||!pDocShell->GetDoc())
536
		throw RuntimeException();
542
		throw RuntimeException();
537
	if(!xBodyText.is())
543
	if(!xBodyText.is())
538
	{
544
	{
Lines 556-562 Link Here
556
void SwXTextDocument::lockControllers(void) throw( RuntimeException )
562
void SwXTextDocument::lockControllers(void) throw( RuntimeException )
557
{
563
{
558
	::vos::OGuard aGuard(Application::GetSolarMutex());
564
	::vos::OGuard aGuard(Application::GetSolarMutex());
559
	if(IsValid())
565
    if(IsValid()||!pDocShell->GetDoc())
560
	{
566
	{
561
		UnoActionContext* pContext = new UnoActionContext(pDocShell->GetDoc());
567
		UnoActionContext* pContext = new UnoActionContext(pDocShell->GetDoc());
562
		aActionArr.Insert(pContext, 0);
568
		aActionArr.Insert(pContext, 0);
Lines 701-707 Link Here
701
			throw( RuntimeException )
707
			throw( RuntimeException )
702
{
708
{
703
	::vos::OGuard aGuard(Application::GetSolarMutex());
709
	::vos::OGuard aGuard(Application::GetSolarMutex());
704
	if(IsValid())
710
    if(IsValid()||!pDocShell->GetDoc())
705
	{
711
	{
706
		if(!pxXLineNumberingProperties)
712
		if(!pxXLineNumberingProperties)
707
		{
713
		{
Lines 733-739 Link Here
733
Reference< XIndexAccess >  SwXTextDocument::getNumberingRules(void) throw( RuntimeException )
739
Reference< XIndexAccess >  SwXTextDocument::getNumberingRules(void) throw( RuntimeException )
734
{
740
{
735
    ::vos::OGuard aGuard(Application::GetSolarMutex());
741
    ::vos::OGuard aGuard(Application::GetSolarMutex());
736
    if(!IsValid())
742
    if(!IsValid()||!pDocShell->GetDoc())
737
        throw RuntimeException();
743
        throw RuntimeException();
738
    if(!pxXNumberingRules )
744
    if(!pxXNumberingRules )
739
    {
745
    {
Lines 749-755 Link Here
749
Reference< XIndexAccess >  SwXTextDocument::getFootnotes(void) throw( RuntimeException )
755
Reference< XIndexAccess >  SwXTextDocument::getFootnotes(void) throw( RuntimeException )
750
{
756
{
751
	::vos::OGuard aGuard(Application::GetSolarMutex());
757
	::vos::OGuard aGuard(Application::GetSolarMutex());
752
	if(!IsValid())
758
    if(!IsValid()||!pDocShell->GetDoc())
753
		throw RuntimeException();
759
		throw RuntimeException();
754
	if(!pxXFootnotes)
760
	if(!pxXFootnotes)
755
	{
761
	{
Lines 765-771 Link Here
765
		SwXTextDocument::getFootnoteSettings(void) throw( RuntimeException )
771
		SwXTextDocument::getFootnoteSettings(void) throw( RuntimeException )
766
{
772
{
767
	::vos::OGuard aGuard(Application::GetSolarMutex());
773
	::vos::OGuard aGuard(Application::GetSolarMutex());
768
	if(!IsValid())
774
    if(!IsValid()||!pDocShell->GetDoc())
769
		throw RuntimeException();
775
		throw RuntimeException();
770
	if(!pxXFootnoteSettings)
776
	if(!pxXFootnoteSettings)
771
	{
777
	{
Lines 780-786 Link Here
780
Reference< XIndexAccess >  SwXTextDocument::getEndnotes(void) throw( RuntimeException )
786
Reference< XIndexAccess >  SwXTextDocument::getEndnotes(void) throw( RuntimeException )
781
{
787
{
782
	::vos::OGuard aGuard(Application::GetSolarMutex());
788
	::vos::OGuard aGuard(Application::GetSolarMutex());
783
	if(!IsValid())
789
    if(!IsValid()||!pDocShell->GetDoc())
784
		throw RuntimeException();
790
		throw RuntimeException();
785
	if(!pxXEndnotes)
791
	if(!pxXEndnotes)
786
	{
792
	{
Lines 795-801 Link Here
795
Reference< XPropertySet >  SwXTextDocument::getEndnoteSettings(void) throw( RuntimeException )
801
Reference< XPropertySet >  SwXTextDocument::getEndnoteSettings(void) throw( RuntimeException )
796
{
802
{
797
	::vos::OGuard aGuard(Application::GetSolarMutex());
803
	::vos::OGuard aGuard(Application::GetSolarMutex());
798
	if(!IsValid())
804
    if(!IsValid()||!pDocShell->GetDoc())
799
		throw RuntimeException();
805
		throw RuntimeException();
800
	if(!pxXEndnoteSettings)
806
	if(!pxXEndnoteSettings)
801
	{
807
	{
Lines 845-851 Link Here
845
{
851
{
846
	::vos::OGuard aGuard(Application::GetSolarMutex());
852
	::vos::OGuard aGuard(Application::GetSolarMutex());
847
	Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY);
853
	Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY);
848
	if(!IsValid() || !xDescTunnel.is() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
854
	if(!IsValid() || !pDocShell->GetDoc() ||!xDescTunnel.is() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
849
		throw RuntimeException();
855
		throw RuntimeException();
850
856
851
	Reference< XTextCursor >  xCrsr;
857
	Reference< XTextCursor >  xCrsr;
Lines 930-936 Link Here
930
												Reference< XInterface >  xLastResult)
936
												Reference< XInterface >  xLastResult)
931
{
937
{
932
	Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY);
938
	Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY);
933
	if(!IsValid() || !xDescTunnel.is() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
939
	if(!IsValid() || !pDocShell->GetDoc() || 
940
            !xDescTunnel.is() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
934
		return 0;
941
		return 0;
935
942
936
	SwUnoCrsr* 	pUnoCrsr = CreateCursorForSearch(xCrsr);
943
	SwUnoCrsr* 	pUnoCrsr = CreateCursorForSearch(xCrsr);
Lines 1128-1134 Link Here
1128
{
1135
{
1129
	::vos::OGuard aGuard(Application::GetSolarMutex());
1136
	::vos::OGuard aGuard(Application::GetSolarMutex());
1130
	Sequence< beans::PropertyValue > aSeq(9);
1137
	Sequence< beans::PropertyValue > aSeq(9);
1131
	if(IsValid())
1138
	if(IsValid() && pDocShell->GetDoc())
1132
	{
1139
	{
1133
		beans::PropertyValue* pArray = aSeq.getArray();
1140
		beans::PropertyValue* pArray = aSeq.getArray();
1134
		SwPagePreViewPrtData aData;
1141
		SwPagePreViewPrtData aData;
Lines 1212-1218 Link Here
1212
	throw( RuntimeException )
1219
	throw( RuntimeException )
1213
{
1220
{
1214
	::vos::OGuard aGuard(Application::GetSolarMutex());
1221
	::vos::OGuard aGuard(Application::GetSolarMutex());
1215
	if(IsValid())
1222
	if(IsValid() && pDocShell->GetDoc())
1216
	{
1223
	{
1217
		SwPagePreViewPrtData aData;
1224
		SwPagePreViewPrtData aData;
1218
		//falls nur einige Properties kommen, dann die akt. Einstellungen benutzen
1225
		//falls nur einige Properties kommen, dann die akt. Einstellungen benutzen
Lines 1285-1291 Link Here
1285
	throw( IllegalArgumentException, RuntimeException )
1292
	throw( IllegalArgumentException, RuntimeException )
1286
{
1293
{
1287
	::vos::OGuard aGuard(Application::GetSolarMutex());
1294
	::vos::OGuard aGuard(Application::GetSolarMutex());
1288
	if(IsValid())
1295
	if(IsValid() && pDocShell->GetDoc())
1289
	{
1296
	{
1290
        SfxViewFrame* pFrame = SfxViewFrame::CreateViewFrame( *pDocShell, 7, sal_True );
1297
        SfxViewFrame* pFrame = SfxViewFrame::CreateViewFrame( *pDocShell, 7, sal_True );
1291
		SfxRequest aReq(FN_PRINT_PAGEPREVIEW, SFX_CALLMODE_SYNCHRON,
1298
		SfxRequest aReq(FN_PRINT_PAGEPREVIEW, SFX_CALLMODE_SYNCHRON,
Lines 1373-1379 Link Here
1373
										throw( RuntimeException )
1380
										throw( RuntimeException )
1374
{
1381
{
1375
	::vos::OGuard aGuard(Application::GetSolarMutex());
1382
	::vos::OGuard aGuard(Application::GetSolarMutex());
1376
	if(!IsValid())
1383
	if(!IsValid() ||!pDocShell->GetDoc())
1377
		throw RuntimeException();
1384
		throw RuntimeException();
1378
	if(!pxXReferenceMarks)
1385
	if(!pxXReferenceMarks)
1379
	{
1386
	{
Lines 1388-1394 Link Here
1388
Reference< XEnumerationAccess >  SwXTextDocument::getTextFields(void) throw( RuntimeException )
1395
Reference< XEnumerationAccess >  SwXTextDocument::getTextFields(void) throw( RuntimeException )
1389
{
1396
{
1390
	::vos::OGuard aGuard(Application::GetSolarMutex());
1397
	::vos::OGuard aGuard(Application::GetSolarMutex());
1391
	if(!IsValid())
1398
	if(!IsValid() || !pDocShell->GetDoc())
1392
		throw RuntimeException();
1399
		throw RuntimeException();
1393
	if(!pxXTextFieldTypes)
1400
	if(!pxXTextFieldTypes)
1394
	{
1401
	{
Lines 1404-1410 Link Here
1404
	throw( RuntimeException )
1411
	throw( RuntimeException )
1405
{
1412
{
1406
	::vos::OGuard aGuard(Application::GetSolarMutex());
1413
	::vos::OGuard aGuard(Application::GetSolarMutex());
1407
	if(!IsValid())
1414
	if(!IsValid()||!pDocShell->GetDoc())
1408
		throw RuntimeException();
1415
		throw RuntimeException();
1409
	if(!pxXTextFieldMasters)
1416
	if(!pxXTextFieldMasters)
1410
	{
1417
	{
Lines 1419-1425 Link Here
1419
Reference< XNameAccess >  SwXTextDocument::getEmbeddedObjects(void) throw( RuntimeException )
1426
Reference< XNameAccess >  SwXTextDocument::getEmbeddedObjects(void) throw( RuntimeException )
1420
{
1427
{
1421
	::vos::OGuard aGuard(Application::GetSolarMutex());
1428
	::vos::OGuard aGuard(Application::GetSolarMutex());
1422
	if(!IsValid())
1429
	if(!IsValid()||!pDocShell->GetDoc())
1423
		throw RuntimeException();
1430
		throw RuntimeException();
1424
	if(!pxXEmbeddedObjects)
1431
	if(!pxXEmbeddedObjects)
1425
	{
1432
	{
Lines 1434-1440 Link Here
1434
Reference< XNameAccess >  SwXTextDocument::getBookmarks(void) throw( RuntimeException )
1441
Reference< XNameAccess >  SwXTextDocument::getBookmarks(void) throw( RuntimeException )
1435
{
1442
{
1436
	::vos::OGuard aGuard(Application::GetSolarMutex());
1443
	::vos::OGuard aGuard(Application::GetSolarMutex());
1437
	if(!IsValid())
1444
	if(!IsValid()||!pDocShell->GetDoc())
1438
		throw RuntimeException();
1445
		throw RuntimeException();
1439
	if(!pxXBookmarks)
1446
	if(!pxXBookmarks)
1440
	{
1447
	{
Lines 1449-1455 Link Here
1449
Reference< XNameAccess >  SwXTextDocument::getTextSections(void) throw( RuntimeException )
1456
Reference< XNameAccess >  SwXTextDocument::getTextSections(void) throw( RuntimeException )
1450
{
1457
{
1451
	::vos::OGuard aGuard(Application::GetSolarMutex());
1458
	::vos::OGuard aGuard(Application::GetSolarMutex());
1452
	if(!IsValid())
1459
	if(!IsValid()||!pDocShell->GetDoc())
1453
		throw RuntimeException();
1460
		throw RuntimeException();
1454
	if(!pxXTextSections)
1461
	if(!pxXTextSections)
1455
	{
1462
	{
Lines 1464-1470 Link Here
1464
Reference< XNameAccess >  SwXTextDocument::getTextTables(void) throw( RuntimeException )
1471
Reference< XNameAccess >  SwXTextDocument::getTextTables(void) throw( RuntimeException )
1465
{
1472
{
1466
	::vos::OGuard aGuard(Application::GetSolarMutex());
1473
	::vos::OGuard aGuard(Application::GetSolarMutex());
1467
	if(!IsValid())
1474
	if(!IsValid()||!pDocShell->GetDoc())
1468
		throw RuntimeException();
1475
		throw RuntimeException();
1469
	if(!pxXTextTables)
1476
	if(!pxXTextTables)
1470
	{
1477
	{
Lines 1479-1485 Link Here
1479
Reference< XNameAccess >  SwXTextDocument::getGraphicObjects(void) throw( RuntimeException )
1486
Reference< XNameAccess >  SwXTextDocument::getGraphicObjects(void) throw( RuntimeException )
1480
{
1487
{
1481
	::vos::OGuard aGuard(Application::GetSolarMutex());
1488
	::vos::OGuard aGuard(Application::GetSolarMutex());
1482
	if(!IsValid())
1489
	if(!IsValid()||!pDocShell->GetDoc())
1483
		throw RuntimeException();
1490
		throw RuntimeException();
1484
	if(!pxXGraphicObjects)
1491
	if(!pxXGraphicObjects)
1485
	{
1492
	{
Lines 1494-1500 Link Here
1494
Reference< XNameAccess >  SwXTextDocument::getTextFrames(void) throw( RuntimeException )
1501
Reference< XNameAccess >  SwXTextDocument::getTextFrames(void) throw( RuntimeException )
1495
{
1502
{
1496
	::vos::OGuard aGuard(Application::GetSolarMutex());
1503
	::vos::OGuard aGuard(Application::GetSolarMutex());
1497
	if(!IsValid())
1504
	if(!IsValid()||!pDocShell->GetDoc())
1498
		throw RuntimeException();
1505
		throw RuntimeException();
1499
	if(!pxXTextFrames)
1506
	if(!pxXTextFrames)
1500
	{
1507
	{
Lines 1509-1515 Link Here
1509
Reference< XNameAccess >  SwXTextDocument::getStyleFamilies(void) throw( RuntimeException )
1516
Reference< XNameAccess >  SwXTextDocument::getStyleFamilies(void) throw( RuntimeException )
1510
{
1517
{
1511
	::vos::OGuard aGuard(Application::GetSolarMutex());
1518
	::vos::OGuard aGuard(Application::GetSolarMutex());
1512
	if(!IsValid())
1519
	if(!IsValid()||!pDocShell->GetDoc())
1513
		throw RuntimeException();
1520
		throw RuntimeException();
1514
	if(!pxXStyleFamilies)
1521
	if(!pxXStyleFamilies)
1515
	{
1522
	{
Lines 1541-1547 Link Here
1541
Reference< drawing::XDrawPage >  SwXTextDocument::getDrawPage(void) throw( RuntimeException )
1548
Reference< drawing::XDrawPage >  SwXTextDocument::getDrawPage(void) throw( RuntimeException )
1542
{
1549
{
1543
	::vos::OGuard aGuard(Application::GetSolarMutex());
1550
	::vos::OGuard aGuard(Application::GetSolarMutex());
1544
	if(!IsValid())
1551
	if(!IsValid()||!pDocShell->GetDoc())
1545
		throw RuntimeException();
1552
		throw RuntimeException();
1546
	if(!pxXDrawPage)
1553
	if(!pxXDrawPage)
1547
	{
1554
	{
Lines 1811-1817 Link Here
1811
										throw( Exception, RuntimeException )
1818
										throw( Exception, RuntimeException )
1812
{
1819
{
1813
	::vos::OGuard aGuard(Application::GetSolarMutex());
1820
	::vos::OGuard aGuard(Application::GetSolarMutex());
1814
	if(!IsValid())
1821
	if(!IsValid()||!pDocShell->GetDoc())
1815
		throw RuntimeException();
1822
		throw RuntimeException();
1816
	Reference< XInterface >  xRet;
1823
	Reference< XInterface >  xRet;
1817
	sal_uInt16 nType = SwXServiceProvider::GetProviderType(rServiceName);
1824
	sal_uInt16 nType = SwXServiceProvider::GetProviderType(rServiceName);
Lines 2007-2013 Link Here
2007
Reference< XIndexAccess >  SwXTextDocument::getDocumentIndexes(void) throw( RuntimeException )
2014
Reference< XIndexAccess >  SwXTextDocument::getDocumentIndexes(void) throw( RuntimeException )
2008
{
2015
{
2009
	::vos::OGuard aGuard(Application::GetSolarMutex());
2016
	::vos::OGuard aGuard(Application::GetSolarMutex());
2010
	if(!IsValid())
2017
	if(!IsValid()||!pDocShell->GetDoc())
2011
		throw RuntimeException();
2018
		throw RuntimeException();
2012
	if(!pxXDocumentIndexes)
2019
	if(!pxXDocumentIndexes)
2013
	{
2020
	{
Lines 2060-2066 Link Here
2060
		case WID_DOC_CHANGES_SHOW:
2067
		case WID_DOC_CHANGES_SHOW:
2061
		{
2068
		{
2062
			sal_Bool bSet = *(sal_Bool*)aValue.getValue();
2069
			sal_Bool bSet = *(sal_Bool*)aValue.getValue();
2063
			sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode();
2070
			if(!pDocShell->GetDoc())
2071
                throw uno::RuntimeException();
2072
            sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode();
2064
			if(WID_DOC_CHANGES_SHOW == pMap->nWID)
2073
			if(WID_DOC_CHANGES_SHOW == pMap->nWID)
2065
			{
2074
			{
2066
				eMode &= ~(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE);
2075
				eMode &= ~(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE);
Lines 2080-2085 Link Here
2080
            Sequence <sal_Int8> aNew;
2089
            Sequence <sal_Int8> aNew;
2081
            if(aValue >>= aNew)
2090
            if(aValue >>= aNew)
2082
            {
2091
            {
2092
			    if(!pDocShell->GetDoc())
2093
                    throw uno::RuntimeException();
2083
                SwDoc* pDoc = pDocShell->GetDoc();
2094
                SwDoc* pDoc = pDocShell->GetDoc();
2084
                pDoc->SetRedlinePassword(aNew);
2095
                pDoc->SetRedlinePassword(aNew);
2085
                if(aNew.getLength())
2096
                if(aNew.getLength())
Lines 2093-2098 Link Here
2093
        break;
2104
        break;
2094
		case WID_DOC_AUTO_MARK_URL :
2105
		case WID_DOC_AUTO_MARK_URL :
2095
		{
2106
		{
2107
			if(!pDocShell->GetDoc())
2108
                throw uno::RuntimeException();
2096
			OUString sURL;
2109
			OUString sURL;
2097
			aValue >>= sURL;
2110
			aValue >>= sURL;
2098
			pDocShell->GetDoc()->SetTOIAutoMarkURL(sURL);
2111
			pDocShell->GetDoc()->SetTOIAutoMarkURL(sURL);
Lines 2103-2108 Link Here
2103
		break;
2116
		break;
2104
		case WID_DOC_REDLINE_DISPLAY:
2117
		case WID_DOC_REDLINE_DISPLAY:
2105
		{
2118
		{
2119
			if(!pDocShell->GetDoc())
2120
                throw uno::RuntimeException();
2106
			sal_Int16 eRedMode = pDocShell->GetDoc()->GetRedlineMode();
2121
			sal_Int16 eRedMode = pDocShell->GetDoc()->GetRedlineMode();
2107
			eRedMode = eRedMode & (~nsRedlineMode_t::REDLINE_SHOW_MASK);
2122
			eRedMode = eRedMode & (~nsRedlineMode_t::REDLINE_SHOW_MASK);
2108
			sal_Int16 nSet = 0;
2123
			sal_Int16 nSet = 0;
Lines 2122-2127 Link Here
2122
		break;
2137
		break;
2123
		case WID_DOC_TWO_DIGIT_YEAR:
2138
		case WID_DOC_TWO_DIGIT_YEAR:
2124
		{
2139
		{
2140
			if(!pDocShell->GetDoc())
2141
                throw uno::RuntimeException();
2125
			sal_Int16 nYear = 0;
2142
			sal_Int16 nYear = 0;
2126
			aValue >>= nYear;
2143
			aValue >>= nYear;
2127
			SfxRequest aRequest ( SID_ATTR_YEAR2000, SFX_CALLMODE_SLOT, pDocShell->GetDoc()->GetAttrPool());
2144
			SfxRequest aRequest ( SID_ATTR_YEAR2000, SFX_CALLMODE_SLOT, pDocShell->GetDoc()->GetAttrPool());
Lines 2131-2136 Link Here
2131
		break;
2148
		break;
2132
		case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
2149
		case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
2133
		{
2150
		{
2151
			if(!pDocShell->GetDoc())
2152
                throw uno::RuntimeException();
2134
			SwDrawDocument * pDrawDoc;
2153
			SwDrawDocument * pDrawDoc;
2135
			sal_Bool bAuto = *(sal_Bool*) aValue.getValue();
2154
			sal_Bool bAuto = *(sal_Bool*) aValue.getValue();
2136
2155
Lines 2152-2157 Link Here
2152
		break;
2171
		break;
2153
		case WID_DOC_APPLY_FORM_DESIGN_MODE:
2172
		case WID_DOC_APPLY_FORM_DESIGN_MODE:
2154
		{
2173
		{
2174
			if(!pDocShell->GetDoc())
2175
                throw uno::RuntimeException();
2155
			SwDrawDocument * pDrawDoc;
2176
			SwDrawDocument * pDrawDoc;
2156
			sal_Bool bMode = *(sal_Bool*)aValue.getValue();
2177
			sal_Bool bMode = *(sal_Bool*)aValue.getValue();
2157
2178
Lines 2176-2181 Link Here
2176
        // flag at the document, used during binary import
2197
        // flag at the document, used during binary import
2177
        case WID_DOC_LOCK_UPDATES :
2198
        case WID_DOC_LOCK_UPDATES :
2178
        {
2199
        {
2200
			if(!pDocShell->GetDoc())
2201
                throw uno::RuntimeException();
2179
            SwDoc* pDoc = pDocShell->GetDoc();
2202
            SwDoc* pDoc = pDocShell->GetDoc();
2180
            bool bBool (false);
2203
            bool bBool (false);
2181
            if( aValue >>= bBool )
2204
            if( aValue >>= bBool )
Lines 2189-2194 Link Here
2189
        // --> OD 2006-03-21 #b6375613#
2212
        // --> OD 2006-03-21 #b6375613#
2190
        case WID_APPLY_WORKAROUND_FOR_B6375613:
2213
        case WID_APPLY_WORKAROUND_FOR_B6375613:
2191
        {
2214
        {
2215
			if(!pDocShell->GetDoc())
2216
                throw uno::RuntimeException();
2192
            bool bApplyWorkaroundForB6375613( false );
2217
            bool bApplyWorkaroundForB6375613( false );
2193
            aValue >>= bApplyWorkaroundForB6375613;
2218
            aValue >>= bApplyWorkaroundForB6375613;
2194
            pDocShell->GetDoc()->SetApplyWorkaroundForB6375613( bApplyWorkaroundForB6375613 );
2219
            pDocShell->GetDoc()->SetApplyWorkaroundForB6375613( bApplyWorkaroundForB6375613 );
Lines 2198-2203 Link Here
2198
2223
2199
        default:
2224
        default:
2200
		{
2225
		{
2226
			if(!pDocShell->GetDoc())
2227
                throw uno::RuntimeException();
2201
			const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pMap->nWID);
2228
			const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pMap->nWID);
2202
			SfxPoolItem* pNewItem = rItem.Clone();
2229
			SfxPoolItem* pNewItem = rItem.Clone();
2203
			pNewItem->PutValue(aValue, pMap->nMemberId);
2230
			pNewItem->PutValue(aValue, pMap->nMemberId);
Lines 2227-2232 Link Here
2227
		case  WID_DOC_PARA_COUNT     :
2254
		case  WID_DOC_PARA_COUNT     :
2228
		case  WID_DOC_WORD_COUNT     :
2255
		case  WID_DOC_WORD_COUNT     :
2229
		{
2256
		{
2257
			if(!pDocShell->GetDoc())
2258
                throw uno::RuntimeException();
2230
			SwDocStat aStat(pDocShell->GetDoc()->GetDocStat());
2259
			SwDocStat aStat(pDocShell->GetDoc()->GetDocStat());
2231
			if(aStat.bModified)
2260
			if(aStat.bModified)
2232
				pDocShell->GetDoc()->UpdateDocStat( aStat );
2261
				pDocShell->GetDoc()->UpdateDocStat( aStat );
Lines 2248-2253 Link Here
2248
		case WID_DOC_CHANGES_RECORD:
2277
		case WID_DOC_CHANGES_RECORD:
2249
		case WID_DOC_CHANGES_SHOW:
2278
		case WID_DOC_CHANGES_SHOW:
2250
		{
2279
		{
2280
			if(!pDocShell->GetDoc())
2281
                throw uno::RuntimeException();
2251
			sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode();
2282
			sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode();
2252
			sal_Bool bSet = sal_False;
2283
			sal_Bool bSet = sal_False;
2253
			if(WID_DOC_CHANGES_SHOW == pMap->nWID)
2284
			if(WID_DOC_CHANGES_SHOW == pMap->nWID)
Lines 2264-2274 Link Here
2264
		break;
2295
		break;
2265
        case  WID_DOC_CHANGES_PASSWORD:
2296
        case  WID_DOC_CHANGES_PASSWORD:
2266
        {
2297
        {
2298
			if(!pDocShell->GetDoc())
2299
                throw uno::RuntimeException();
2267
            SwDoc* pDoc = pDocShell->GetDoc();
2300
            SwDoc* pDoc = pDocShell->GetDoc();
2268
            aAny <<= pDoc->GetRedlinePassword();
2301
            aAny <<= pDoc->GetRedlinePassword();
2269
        }
2302
        }
2270
        break;
2303
        break;
2271
		case WID_DOC_AUTO_MARK_URL :
2304
		case WID_DOC_AUTO_MARK_URL :
2305
			if(!pDocShell->GetDoc())
2306
                throw uno::RuntimeException();
2272
			aAny <<= OUString(pDocShell->GetDoc()->GetTOIAutoMarkURL());
2307
			aAny <<= OUString(pDocShell->GetDoc()->GetTOIAutoMarkURL());
2273
		break;
2308
		break;
2274
		case WID_DOC_HIDE_TIPS :
2309
		case WID_DOC_HIDE_TIPS :
Lines 2279-2284 Link Here
2279
		break;
2314
		break;
2280
		case WID_DOC_REDLINE_DISPLAY:
2315
		case WID_DOC_REDLINE_DISPLAY:
2281
		{
2316
		{
2317
			if(!pDocShell->GetDoc())
2318
                throw uno::RuntimeException();
2282
			sal_Int16 eRedMode = pDocShell->GetDoc()->GetRedlineMode();
2319
			sal_Int16 eRedMode = pDocShell->GetDoc()->GetRedlineMode();
2283
			eRedMode = eRedMode & nsRedlineMode_t::REDLINE_SHOW_MASK;
2320
			eRedMode = eRedMode & nsRedlineMode_t::REDLINE_SHOW_MASK;
2284
			sal_Int16 nRet = RedlineDisplayType::NONE;
2321
			sal_Int16 nRet = RedlineDisplayType::NONE;
Lines 2300-2310 Link Here
2300
		break;
2337
		break;
2301
		case WID_DOC_TWO_DIGIT_YEAR:
2338
		case WID_DOC_TWO_DIGIT_YEAR:
2302
		{
2339
		{
2340
			if(!pDocShell->GetDoc())
2341
                throw uno::RuntimeException();
2303
			aAny <<= static_cast < sal_Int16 > (pDocShell->GetDoc()->GetNumberFormatter ( TRUE )->GetYear2000());
2342
			aAny <<= static_cast < sal_Int16 > (pDocShell->GetDoc()->GetNumberFormatter ( TRUE )->GetYear2000());
2304
		}
2343
		}
2305
		break;
2344
		break;
2306
		case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
2345
		case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
2307
		{
2346
		{
2347
			if(!pDocShell->GetDoc())
2348
                throw uno::RuntimeException();
2308
			SwDrawDocument * pDrawDoc;
2349
			SwDrawDocument * pDrawDoc;
2309
			sal_Bool bAuto;
2350
			sal_Bool bAuto;
2310
            if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) )
2351
            if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) )
Lines 2316-2321 Link Here
2316
		break;
2357
		break;
2317
		case WID_DOC_APPLY_FORM_DESIGN_MODE:
2358
		case WID_DOC_APPLY_FORM_DESIGN_MODE:
2318
		{
2359
		{
2360
			if(!pDocShell->GetDoc())
2361
                throw uno::RuntimeException();
2319
			SwDrawDocument * pDrawDoc;
2362
			SwDrawDocument * pDrawDoc;
2320
			sal_Bool bMode;
2363
			sal_Bool bMode;
2321
            if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) )
2364
            if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) )
Lines 2335-2340 Link Here
2335
            aAny <<= getRuntimeUID();
2378
            aAny <<= getRuntimeUID();
2336
        break;
2379
        break;
2337
        case WID_DOC_LOCK_UPDATES :
2380
        case WID_DOC_LOCK_UPDATES :
2381
			if(!pDocShell->GetDoc())
2382
                throw uno::RuntimeException();
2338
            aAny <<= static_cast<bool>( pDocShell->GetDoc()->IsInReading() );
2383
            aAny <<= static_cast<bool>( pDocShell->GetDoc()->IsInReading() );
2339
        break;
2384
        break;
2340
		case WID_DOC_BUILDID:
2385
		case WID_DOC_BUILDID:
Lines 2346-2351 Link Here
2346
        // --> OD 2006-03-21 #b6375613#
2391
        // --> OD 2006-03-21 #b6375613#
2347
        case WID_APPLY_WORKAROUND_FOR_B6375613:
2392
        case WID_APPLY_WORKAROUND_FOR_B6375613:
2348
        {
2393
        {
2394
			if(!pDocShell->GetDoc())
2395
                throw uno::RuntimeException();
2349
            aAny <<= pDocShell->GetDoc()->ApplyWorkaroundForB6375613();
2396
            aAny <<= pDocShell->GetDoc()->ApplyWorkaroundForB6375613();
2350
        }
2397
        }
2351
        break;
2398
        break;
Lines 2353-2358 Link Here
2353
2400
2354
		default:
2401
		default:
2355
		{
2402
		{
2403
			if(!pDocShell->GetDoc())
2404
                throw uno::RuntimeException();
2356
			const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pMap->nWID);
2405
			const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pMap->nWID);
2357
			rItem.QueryValue(aAny, pMap->nMemberId);
2406
			rItem.QueryValue(aAny, pMap->nMemberId);
2358
		}
2407
		}
Lines 2414-2419 Link Here
2414
{
2463
{
2415
	if(!pxXRedlines)
2464
	if(!pxXRedlines)
2416
	{
2465
	{
2466
		if(!pDocShell->GetDoc())
2467
            throw uno::RuntimeException();
2417
		pxXRedlines = new Reference< XEnumerationAccess > ;
2468
		pxXRedlines = new Reference< XEnumerationAccess > ;
2418
		(*pxXRedlines) = new SwXRedlines(pDocShell->GetDoc());
2469
		(*pxXRedlines) = new SwXRedlines(pDocShell->GetDoc());
2419
	}
2470
	}
Lines 2459-2465 Link Here
2459
void SwXTextDocument::updateLinks(  ) throw(RuntimeException)
2510
void SwXTextDocument::updateLinks(  ) throw(RuntimeException)
2460
{
2511
{
2461
	::vos::OGuard aGuard(Application::GetSolarMutex());
2512
	::vos::OGuard aGuard(Application::GetSolarMutex());
2462
	if(!IsValid())
2513
	if(!IsValid()||!pDocShell->GetDoc())
2463
		throw RuntimeException();
2514
		throw RuntimeException();
2464
	SwDoc* pDoc = pDocShell->GetDoc();
2515
	SwDoc* pDoc = pDocShell->GetDoc();
2465
  	SvxLinkManager& rLnkMan = pDoc->GetLinkManager();
2516
  	SvxLinkManager& rLnkMan = pDoc->GetLinkManager();
Lines 2897-2903 Link Here
2897
Reference<XNameContainer> SAL_CALL SwXTextDocument::getXForms()
2948
Reference<XNameContainer> SAL_CALL SwXTextDocument::getXForms()
2898
    throw( RuntimeException )
2949
    throw( RuntimeException )
2899
{
2950
{
2900
    if ( !pDocShell )
2951
    if ( !pDocShell ||!pDocShell->GetDoc())
2901
        throw DisposedException( ::rtl::OUString(), static_cast< XTextDocument* >( this ) );
2952
        throw DisposedException( ::rtl::OUString(), static_cast< XTextDocument* >( this ) );
2902
    SwDoc* pDoc = pDocShell->GetDoc();
2953
    SwDoc* pDoc = pDocShell->GetDoc();
2903
    return pDoc->getXForms();
2954
    return pDoc->getXForms();

Return to issue 81497