docsh2.cxx (8ef2f12b) | docsh2.cxx (86104fa7) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 182 unchanged lines hidden (view full) --- 191 pTempView->SetNewWindowAllowed(!bSet); 192 } 193} 194// End of disabled "multiple layout" 195 196/// update text fields on document properties changes 197void SwDocShell::DoFlushDocInfo() 198{ | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 182 unchanged lines hidden (view full) --- 191 pTempView->SetNewWindowAllowed(!bSet); 192 } 193} 194// End of disabled "multiple layout" 195 196/// update text fields on document properties changes 197void SwDocShell::DoFlushDocInfo() 198{ |
199 if ( !pDoc ) return; | 199 if ( !mpDoc ) return; |
200 201 bool bUnlockView(true); | 200 201 bool bUnlockView(true); |
202 if ( pWrtShell ) { 203 bUnlockView = !pWrtShell->IsViewLocked(); 204 pWrtShell->LockView( sal_True ); // lock visible section 205 pWrtShell->StartAllAction(); | 202 if ( mpWrtShell ) { 203 bUnlockView = !mpWrtShell->IsViewLocked(); 204 mpWrtShell->LockView( sal_True ); // lock visible section 205 mpWrtShell->StartAllAction(); |
206 } 207 | 206 } 207 |
208 pDoc->DocInfoChgd(); | 208 mpDoc->DocInfoChgd(); |
209 | 209 |
210 if ( pWrtShell ) { 211 pWrtShell->EndAllAction(); | 210 if ( mpWrtShell ) { 211 mpWrtShell->EndAllAction(); |
212 if ( bUnlockView ) { | 212 if ( bUnlockView ) { |
213 pWrtShell->LockView( sal_False ); | 213 mpWrtShell->LockView( sal_False ); |
214 } 215 } 216} 217 218#ifdef FUTURE_VBA 219void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventProcessor >& xVbaEvents, const SfxHint& rHint ) 220{ 221 using namespace com::sun::star::script::vba::VBAEventId; --- 15 unchanged lines hidden (view full) --- 237#endif 238 239/*-------------------------------------------------------------------- 240 Beschreibung: Benachrichtigung bei geaenderter DocInfo 241 --------------------------------------------------------------------*/ 242 243void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) 244{ | 214 } 215 } 216} 217 218#ifdef FUTURE_VBA 219void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventProcessor >& xVbaEvents, const SfxHint& rHint ) 220{ 221 using namespace com::sun::star::script::vba::VBAEventId; --- 15 unchanged lines hidden (view full) --- 237#endif 238 239/*-------------------------------------------------------------------- 240 Beschreibung: Benachrichtigung bei geaenderter DocInfo 241 --------------------------------------------------------------------*/ 242 243void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) 244{ |
245 if( !pDoc ) | 245 if( !mpDoc ) |
246 { 247 return ; 248 } 249 250#ifdef FUTURE_VBA | 246 { 247 return ; 248 } 249 250#ifdef FUTURE_VBA |
251 uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); | 251 uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = mpDoc->GetVbaEventProcessor(); |
252 if( xVbaEvents.is() ) 253 lcl_processCompatibleSfxHint( xVbaEvents, rHint ); 254#endif 255 256 sal_uInt16 nAction = 0; 257 if( rHint.ISA(SfxSimpleHint) ) 258 { 259 // swithc for more actions --- 9 unchanged lines hidden (view full) --- 269 ((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_LOADFINISHED ) 270 { 271 nAction = 3; 272 } 273 274 if( nAction ) 275 { 276 sal_Bool bUnlockView = sal_True; //initializing prevents warning | 252 if( xVbaEvents.is() ) 253 lcl_processCompatibleSfxHint( xVbaEvents, rHint ); 254#endif 255 256 sal_uInt16 nAction = 0; 257 if( rHint.ISA(SfxSimpleHint) ) 258 { 259 // swithc for more actions --- 9 unchanged lines hidden (view full) --- 269 ((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_LOADFINISHED ) 270 { 271 nAction = 3; 272 } 273 274 if( nAction ) 275 { 276 sal_Bool bUnlockView = sal_True; //initializing prevents warning |
277 if( pWrtShell ) | 277 if( mpWrtShell ) |
278 { | 278 { |
279 bUnlockView = !pWrtShell->IsViewLocked(); 280 pWrtShell->LockView( sal_True ); //lock visible section 281 pWrtShell->StartAllAction(); | 279 bUnlockView = !mpWrtShell->IsViewLocked(); 280 mpWrtShell->LockView( sal_True ); //lock visible section 281 mpWrtShell->StartAllAction(); |
282 } 283 switch( nAction ) 284 { 285 case 2: | 282 } 283 switch( nAction ) 284 { 285 case 2: |
286 pDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds(); | 286 mpDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds(); |
287 break; 288 289 // own action for event LOADFINISHED in order to avoid a modified document. 290 // Also for the instance of <SwDoc> it has to be assured, that it's not modified. 291 // Perform the same as for action id 1, but disable <SetModified>. 292 case 3: 293 { 294 const bool bResetModified = IsEnableSetModified(); 295 if ( bResetModified ) 296 EnableSetModified( sal_False ); | 287 break; 288 289 // own action for event LOADFINISHED in order to avoid a modified document. 290 // Also for the instance of <SwDoc> it has to be assured, that it's not modified. 291 // Perform the same as for action id 1, but disable <SetModified>. 292 case 3: 293 { 294 const bool bResetModified = IsEnableSetModified(); 295 if ( bResetModified ) 296 EnableSetModified( sal_False ); |
297 const bool bIsDocModified = pDoc->IsModified(); | 297 const bool bIsDocModified = mpDoc->IsModified(); |
298 | 298 |
299 pDoc->DocInfoChgd( ); | 299 mpDoc->DocInfoChgd( ); |
300 301 if ( !bIsDocModified ) | 300 301 if ( !bIsDocModified ) |
302 pDoc->ResetModified(); | 302 mpDoc->ResetModified(); |
303 if ( bResetModified ) 304 EnableSetModified( sal_True ); 305 } 306 break; 307 } 308 | 303 if ( bResetModified ) 304 EnableSetModified( sal_True ); 305 } 306 break; 307 } 308 |
309 if( pWrtShell ) | 309 if( mpWrtShell ) |
310 { | 310 { |
311 pWrtShell->EndAllAction(); | 311 mpWrtShell->EndAllAction(); |
312 if( bUnlockView ) | 312 if( bUnlockView ) |
313 pWrtShell->LockView( sal_False ); | 313 mpWrtShell->LockView( sal_False ); |
314 } 315 } 316} 317 318/*-------------------------------------------------------------------- 319 Beschreibung: Benachrichtigung Doc schliessen 320 --------------------------------------------------------------------*/ 321 322sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) 323{ 324 sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing ); 325 326 if( sal_True == nRet ) //Unbedingt auf sal_True abfragen! (RET_NEWTASK) 327 EndListening( *this ); 328 329#ifdef FUTURE_VBA | 314 } 315 } 316} 317 318/*-------------------------------------------------------------------- 319 Beschreibung: Benachrichtigung Doc schliessen 320 --------------------------------------------------------------------*/ 321 322sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) 323{ 324 sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing ); 325 326 if( sal_True == nRet ) //Unbedingt auf sal_True abfragen! (RET_NEWTASK) 327 EndListening( *this ); 328 329#ifdef FUTURE_VBA |
330 if( pDoc && IsInPrepareClose() ) | 330 if( mpDoc && IsInPrepareClose() ) |
331 { | 331 { |
332 uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); | 332 uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = mpDoc->GetVbaEventProcessor(); |
333 if( xVbaEvents.is() ) 334 { 335 using namespace com::sun::star::script::vba::VBAEventId; 336 uno::Sequence< uno::Any > aArgs; 337 xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aArgs ); 338 } 339 } 340#endif --- 42 unchanged lines hidden (view full) --- 383 SfxStyleSheetBase* pHisSheet = (*pHisPool)[nSourceIdx2]; 384 385 // wenn so eine Vorlage schon existiert: loeschen! 386 const String& rOldName = pHisSheet->GetName(); 387 SfxStyleFamily eOldFamily( pHisSheet->GetFamily() ); 388 389 // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!! 390 if( ( SFX_STYLE_FAMILY_PAGE == eOldFamily && | 333 if( xVbaEvents.is() ) 334 { 335 using namespace com::sun::star::script::vba::VBAEventId; 336 uno::Sequence< uno::Any > aArgs; 337 xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aArgs ); 338 } 339 } 340#endif --- 42 unchanged lines hidden (view full) --- 383 SfxStyleSheetBase* pHisSheet = (*pHisPool)[nSourceIdx2]; 384 385 // wenn so eine Vorlage schon existiert: loeschen! 386 const String& rOldName = pHisSheet->GetName(); 387 SfxStyleFamily eOldFamily( pHisSheet->GetFamily() ); 388 389 // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!! 390 if( ( SFX_STYLE_FAMILY_PAGE == eOldFamily && |
391 const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName() == | 391 const_cast<const SwDoc *>(mpDoc)->GetPageDesc(0).GetName() == |
392 rOldName ) || 393 ( SFX_STYLE_FAMILY_CHAR == eOldFamily && 394 rOldName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - 395 RES_POOLCOLL_TEXT_BEGIN ] )) 396 return sal_False; 397 398 SfxStyleFamily eMyOldFamily( pMyPool->GetSearchFamily() ); 399 sal_uInt16 nMySrchMask = pMyPool->GetSearchMask(); 400 401 SfxStyleSheetBase* pExist; | 392 rOldName ) || 393 ( SFX_STYLE_FAMILY_CHAR == eOldFamily && 394 rOldName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - 395 RES_POOLCOLL_TEXT_BEGIN ] )) 396 return sal_False; 397 398 SfxStyleFamily eMyOldFamily( pMyPool->GetSearchFamily() ); 399 sal_uInt16 nMySrchMask = pMyPool->GetSearchMask(); 400 401 SfxStyleSheetBase* pExist; |
402 if( ::FindPhyStyle( *pDoc, rOldName, eOldFamily ) ) | 402 if( ::FindPhyStyle( *mpDoc, rOldName, eOldFamily ) ) |
403 { 404 // Bug 20365: nur uebernehmen, wenn das gewuenscht ist! 405 if( ERRCODE_BUTTON_OK != ErrorHandler::HandleError( 406 *new MessageInfo( ERRCODE_SFXMSG_STYLEREPLACE, rOldName )) ) 407 { 408 return sal_False; 409 } 410 --- 23 unchanged lines hidden (view full) --- 434 435 rtl::Reference< SwDocStyleSheet > xNewSheet( new SwDocStyleSheet( (SwDocStyleSheet&)pMyPool 436 ->Make(rOldName, eOldFamily, pHisSheet->GetMask() ) ) ); 437 if( SFX_STYLE_FAMILY_PAGE == eOldFamily && rSource.ISA(SwDocShell) ) 438 { 439 // gesondert behandeln!! 440 SwPageDesc* pDestDsc = (SwPageDesc*)xNewSheet->GetPageDesc(); 441 SwPageDesc* pCpyDsc = (SwPageDesc*)((SwDocStyleSheet*)pHisSheet)->GetPageDesc(); | 403 { 404 // Bug 20365: nur uebernehmen, wenn das gewuenscht ist! 405 if( ERRCODE_BUTTON_OK != ErrorHandler::HandleError( 406 *new MessageInfo( ERRCODE_SFXMSG_STYLEREPLACE, rOldName )) ) 407 { 408 return sal_False; 409 } 410 --- 23 unchanged lines hidden (view full) --- 434 435 rtl::Reference< SwDocStyleSheet > xNewSheet( new SwDocStyleSheet( (SwDocStyleSheet&)pMyPool 436 ->Make(rOldName, eOldFamily, pHisSheet->GetMask() ) ) ); 437 if( SFX_STYLE_FAMILY_PAGE == eOldFamily && rSource.ISA(SwDocShell) ) 438 { 439 // gesondert behandeln!! 440 SwPageDesc* pDestDsc = (SwPageDesc*)xNewSheet->GetPageDesc(); 441 SwPageDesc* pCpyDsc = (SwPageDesc*)((SwDocStyleSheet*)pHisSheet)->GetPageDesc(); |
442 pDoc->CopyPageDesc( *pCpyDsc, *pDestDsc ); | 442 mpDoc->CopyPageDesc( *pCpyDsc, *pDestDsc ); |
443 } 444 else 445 // die neue Vorlage mit den Attributen fuellen 446 xNewSheet->SetItemSet( pHisSheet->GetItemSet() ); 447 448 pMyPool->SetSearchMask( SFX_STYLE_FAMILY_ALL, nMySrchMask ); 449 450 if( xNewSheet->IsUserDefined() || xNewSheet->IsUsed() ) --- 83 unchanged lines hidden (view full) --- 534 pMyPool->SetSearchMask( eOldFamily, nMySrchMask ); 535 } 536 } 537 538 // Bug 27347: alte Einstellung wieder setzen 539 pMyPool->SetSearchMask( eMyOldFamily, nMySrchMask ); 540 541 // Model geaendert | 443 } 444 else 445 // die neue Vorlage mit den Attributen fuellen 446 xNewSheet->SetItemSet( pHisSheet->GetItemSet() ); 447 448 pMyPool->SetSearchMask( SFX_STYLE_FAMILY_ALL, nMySrchMask ); 449 450 if( xNewSheet->IsUserDefined() || xNewSheet->IsUsed() ) --- 83 unchanged lines hidden (view full) --- 534 pMyPool->SetSearchMask( eOldFamily, nMySrchMask ); 535 } 536 } 537 538 // Bug 27347: alte Einstellung wieder setzen 539 pMyPool->SetSearchMask( eMyOldFamily, nMySrchMask ); 540 541 // Model geaendert |
542 ASSERT(pDoc, "Doc fehlt"); | 542 ASSERT(mpDoc, "Doc fehlt"); |
543 GetDoc()->SetModified(); 544 545 bRet = sal_True; 546 } 547 else 548 bRet = SfxObjectShell::Insert( rSource, 549 nSourceIdx1, 550 nSourceIdx2, --- 31 unchanged lines hidden (view full) --- 582 pMyPool->First(); // vorm Zugriff Pool aktualisieren!! 583 SfxStyleSheetBase* pMySheet = (*pMyPool)[nIdx2]; 584 585 String aName( pMySheet->GetName() ); 586 SfxStyleFamily eFamily( pMySheet->GetFamily() ); 587 588 // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!! 589 if( ( SFX_STYLE_FAMILY_PAGE == eFamily && | 543 GetDoc()->SetModified(); 544 545 bRet = sal_True; 546 } 547 else 548 bRet = SfxObjectShell::Insert( rSource, 549 nSourceIdx1, 550 nSourceIdx2, --- 31 unchanged lines hidden (view full) --- 582 pMyPool->First(); // vorm Zugriff Pool aktualisieren!! 583 SfxStyleSheetBase* pMySheet = (*pMyPool)[nIdx2]; 584 585 String aName( pMySheet->GetName() ); 586 SfxStyleFamily eFamily( pMySheet->GetFamily() ); 587 588 // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!! 589 if( ( SFX_STYLE_FAMILY_PAGE == eFamily && |
590 const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName() | 590 const_cast<const SwDoc *>(mpDoc)->GetPageDesc(0).GetName() |
591 == aName ) || 592 ( SFX_STYLE_FAMILY_CHAR == eFamily && 593 aName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - 594 RES_POOLCOLL_TEXT_BEGIN ] )) 595 return sal_False; 596 597 // also loeschen 598 pMyPool->Remove( pMySheet ); --- 25 unchanged lines hidden (view full) --- 624 } 625 else 626 bRet = SfxObjectShell::Remove( nIdx1, 627 nIdx2, 628 nIdx3 ); 629 630 631 // Model geaendert | 591 == aName ) || 592 ( SFX_STYLE_FAMILY_CHAR == eFamily && 593 aName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - 594 RES_POOLCOLL_TEXT_BEGIN ] )) 595 return sal_False; 596 597 // also loeschen 598 pMyPool->Remove( pMySheet ); --- 25 unchanged lines hidden (view full) --- 624 } 625 else 626 bRet = SfxObjectShell::Remove( nIdx1, 627 nIdx2, 628 nIdx3 ); 629 630 631 // Model geaendert |
632 ASSERT(pDoc, "Doc fehlt"); | 632 ASSERT(mpDoc, "Doc fehlt"); |
633 GetDoc()->SetModified(); 634 635 return bRet; 636} 637 638/*-------------------------------------------------------------------- 639 Beschreibung: 640 --------------------------------------------------------------------*/ --- 385 unchanged lines hidden (view full) --- 1026 { 1027 sal_uInt8 nLevel = pDlg->GetLevel(); 1028 sal_uInt8 nPara = pDlg->GetPara(); 1029 SwDoc* pSmryDoc = new SwDoc(); 1030 SfxObjectShellLock xDocSh( new SwDocShell( pSmryDoc, SFX_CREATE_MODE_STANDARD)); 1031 xDocSh->DoInitNew( 0 ); 1032 1033 sal_Bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich; | 633 GetDoc()->SetModified(); 634 635 return bRet; 636} 637 638/*-------------------------------------------------------------------- 639 Beschreibung: 640 --------------------------------------------------------------------*/ --- 385 unchanged lines hidden (view full) --- 1026 { 1027 sal_uInt8 nLevel = pDlg->GetLevel(); 1028 sal_uInt8 nPara = pDlg->GetPara(); 1029 SwDoc* pSmryDoc = new SwDoc(); 1030 SfxObjectShellLock xDocSh( new SwDocShell( pSmryDoc, SFX_CREATE_MODE_STANDARD)); 1031 xDocSh->DoInitNew( 0 ); 1032 1033 sal_Bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich; |
1034 pDoc->Summary( pSmryDoc, nLevel, nPara, bImpress ); | 1034 mpDoc->Summary( pSmryDoc, nLevel, nPara, bImpress ); |
1035 if( bImpress ) 1036 { 1037 WriterRef xWrt; 1038 // mba: looks as if relative URLs don't make sense here 1039 ::GetRTFWriter( aEmptyStr, String(), xWrt ); 1040 SvMemoryStream *pStrm = new SvMemoryStream(); 1041 pStrm->SetBufferSize( 16348 ); 1042 SwWriter aWrt( *pStrm, *pSmryDoc ); --- 127 unchanged lines hidden (view full) --- 1170 case SID_SPELLCHECKER_CHANGED: 1171 //! sal_False, sal_True, sal_True is on the save side but a probably overdone 1172 SW_MOD()->CheckSpellChanges(sal_False, sal_True, sal_True, sal_False ); 1173 break; 1174 1175 case SID_MAIL_PREPAREEXPORT: 1176 { 1177 //pWrtShell is not set in page preview | 1035 if( bImpress ) 1036 { 1037 WriterRef xWrt; 1038 // mba: looks as if relative URLs don't make sense here 1039 ::GetRTFWriter( aEmptyStr, String(), xWrt ); 1040 SvMemoryStream *pStrm = new SvMemoryStream(); 1041 pStrm->SetBufferSize( 16348 ); 1042 SwWriter aWrt( *pStrm, *pSmryDoc ); --- 127 unchanged lines hidden (view full) --- 1170 case SID_SPELLCHECKER_CHANGED: 1171 //! sal_False, sal_True, sal_True is on the save side but a probably overdone 1172 SW_MOD()->CheckSpellChanges(sal_False, sal_True, sal_True, sal_False ); 1173 break; 1174 1175 case SID_MAIL_PREPAREEXPORT: 1176 { 1177 //pWrtShell is not set in page preview |
1178 if(pWrtShell) 1179 pWrtShell->StartAllAction(); 1180 pDoc->UpdateFlds( NULL, false ); 1181 pDoc->EmbedAllLinks(); 1182 pDoc->RemoveInvisibleContent(); 1183 if(pWrtShell) 1184 pWrtShell->EndAllAction(); | 1178 if(mpWrtShell) 1179 mpWrtShell->StartAllAction(); 1180 mpDoc->UpdateFlds( NULL, false ); 1181 mpDoc->EmbedAllLinks(); 1182 mpDoc->RemoveInvisibleContent(); 1183 if(mpWrtShell) 1184 mpWrtShell->EndAllAction(); |
1185 } 1186 break; 1187 1188 case SID_MAIL_EXPORT_FINISHED: 1189 { | 1185 } 1186 break; 1187 1188 case SID_MAIL_EXPORT_FINISHED: 1189 { |
1190 if(pWrtShell) 1191 pWrtShell->StartAllAction(); | 1190 if(mpWrtShell) 1191 mpWrtShell->StartAllAction(); |
1192 //try to undo the removal of invisible content | 1192 //try to undo the removal of invisible content |
1193 pDoc->RestoreInvisibleContent(); 1194 if(pWrtShell) 1195 pWrtShell->EndAllAction(); | 1193 mpDoc->RestoreInvisibleContent(); 1194 if(mpWrtShell) 1195 mpWrtShell->EndAllAction(); |
1196 } 1197 break; 1198 case FN_NEW_HTML_DOC: 1199 case FN_NEW_GLOBAL_DOC: 1200 { 1201 bDone = sal_False; 1202 sal_Bool bCreateHtml = FN_NEW_HTML_DOC == nWhich; 1203 --- 124 unchanged lines hidden (view full) --- 1328 // aListBoxEntries.realloc(nIdx); 1329 //<-end,zhaojianwei 1330 1331 1332 //#outline level,add by zhaojianwei 1333 ///////////////////////////////////////////////////////////////////// 1334 1335 bool bOutline[MAXLEVEL] = {false}; | 1196 } 1197 break; 1198 case FN_NEW_HTML_DOC: 1199 case FN_NEW_GLOBAL_DOC: 1200 { 1201 bDone = sal_False; 1202 sal_Bool bCreateHtml = FN_NEW_HTML_DOC == nWhich; 1203 --- 124 unchanged lines hidden (view full) --- 1328 // aListBoxEntries.realloc(nIdx); 1329 //<-end,zhaojianwei 1330 1331 1332 //#outline level,add by zhaojianwei 1333 ///////////////////////////////////////////////////////////////////// 1334 1335 bool bOutline[MAXLEVEL] = {false}; |
1336 const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds(); | 1336 const SwOutlineNodes& rOutlNds = mpDoc->GetNodes().GetOutLineNds(); |
1337 if( rOutlNds.Count() ) 1338 { 1339 int nLevel; 1340 for(sal_uInt16 n = 0; n < rOutlNds.Count(); ++n ) 1341 if( ( nLevel = rOutlNds[n]->GetTxtNode()->GetAttrOutlineLevel()) > 0 && 1342 ! bOutline[nLevel-1] ) 1343 { 1344 bOutline[nLevel-1] = true; 1345 } 1346 } 1347 | 1337 if( rOutlNds.Count() ) 1338 { 1339 int nLevel; 1340 for(sal_uInt16 n = 0; n < rOutlNds.Count(); ++n ) 1341 if( ( nLevel = rOutlNds[n]->GetTxtNode()->GetAttrOutlineLevel()) > 0 && 1342 ! bOutline[nLevel-1] ) 1343 { 1344 bOutline[nLevel-1] = true; 1345 } 1346 } 1347 |
1348 const sal_uInt16 nStyleCount = pDoc->GetTxtFmtColls()->Count(); | 1348 const sal_uInt16 nStyleCount = mpDoc->GetTxtFmtColls()->Count(); |
1349 Sequence<OUString> aListBoxEntries( MAXLEVEL + nStyleCount); 1350 OUString* pEntries = aListBoxEntries.getArray(); 1351 sal_Int32 nIdx = 0 ; 1352 1353 OUString sOutline( SW_RESSTR(STR_FDLG_OUTLINE_LEVEL) ); 1354 for( sal_uInt16 i = 0; i < MAXLEVEL; ++i ) 1355 { 1356 if( bOutline[i] ) 1357 pEntries[nIdx++] = sOutline + String::CreateFromInt32( i+1 ); 1358 } 1359 1360 OUString sStyle( SW_RESSTR(STR_FDLG_STYLE) ); 1361 for(sal_uInt16 i = 0; i < nStyleCount; ++i) 1362 { 1363 SwTxtFmtColl &rTxtColl = | 1349 Sequence<OUString> aListBoxEntries( MAXLEVEL + nStyleCount); 1350 OUString* pEntries = aListBoxEntries.getArray(); 1351 sal_Int32 nIdx = 0 ; 1352 1353 OUString sOutline( SW_RESSTR(STR_FDLG_OUTLINE_LEVEL) ); 1354 for( sal_uInt16 i = 0; i < MAXLEVEL; ++i ) 1355 { 1356 if( bOutline[i] ) 1357 pEntries[nIdx++] = sOutline + String::CreateFromInt32( i+1 ); 1358 } 1359 1360 OUString sStyle( SW_RESSTR(STR_FDLG_STYLE) ); 1361 for(sal_uInt16 i = 0; i < nStyleCount; ++i) 1362 { 1363 SwTxtFmtColl &rTxtColl = |
1364 *pDoc->GetTxtFmtColls()->GetObject( i ); | 1364 *mpDoc->GetTxtFmtColls()->GetObject( i ); |
1365 if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() ) 1366 { 1367 pEntries[nIdx++] = sStyle + rTxtColl.GetName(); 1368 } 1369 } 1370 1371 aListBoxEntries.realloc(nIdx); 1372 sal_Int16 nSelect = 0; --- 65 unchanged lines hidden (view full) --- 1438 SwWait aWait( *this, true ); 1439 1440 //bDone = bCreateHtml //#outline level,removed by zhaojianwei 1441 // ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl ) 1442 // : pDoc->GenerateGlobalDoc( aFileName, pSplitColl ); 1443 if ( bCreateByOutlineLevel ) //add by zhaojianwei 1444 { 1445 bDone = bCreateHtml //#outline level,removed by zhaojianwei | 1365 if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() ) 1366 { 1367 pEntries[nIdx++] = sStyle + rTxtColl.GetName(); 1368 } 1369 } 1370 1371 aListBoxEntries.realloc(nIdx); 1372 sal_Int16 nSelect = 0; --- 65 unchanged lines hidden (view full) --- 1438 SwWait aWait( *this, true ); 1439 1440 //bDone = bCreateHtml //#outline level,removed by zhaojianwei 1441 // ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl ) 1442 // : pDoc->GenerateGlobalDoc( aFileName, pSplitColl ); 1443 if ( bCreateByOutlineLevel ) //add by zhaojianwei 1444 { 1445 bDone = bCreateHtml //#outline level,removed by zhaojianwei |
1446 ? pDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel ) 1447 : pDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel ); | 1446 ? mpDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel ) 1447 : mpDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel ); |
1448 } 1449 else 1450 { 1451 const SwTxtFmtColl* pSplitColl = 0; 1452 if ( aTemplateName.Len() ) | 1448 } 1449 else 1450 { 1451 const SwTxtFmtColl* pSplitColl = 0; 1452 if ( aTemplateName.Len() ) |
1453 pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName); | 1453 pSplitColl = mpDoc->FindTxtFmtCollByName(aTemplateName); |
1454 bDone = bCreateHtml //#outline level,removed by zhaojianwei | 1454 bDone = bCreateHtml //#outline level,removed by zhaojianwei |
1455 ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl ) 1456 : pDoc->GenerateGlobalDoc( aFileName, pSplitColl ); | 1455 ? mpDoc->GenerateHTMLDoc( aFileName, pSplitColl ) 1456 : mpDoc->GenerateGlobalDoc( aFileName, pSplitColl ); |
1457 } 1458 //<-end,zhaojianwei 1459 if( bDone ) 1460 { 1461 SfxStringItem aName( SID_FILE_NAME, aFileName ); 1462 SfxStringItem aReferer( SID_REFERER, aEmptyStr ); 1463 SfxViewShell* pViewShell = SfxViewShell::GetFirst(); 1464 while(pViewShell) --- 45 unchanged lines hidden (view full) --- 1510 { 1511 FmFormShell* pFormShell = pCurrView->GetFormShell(); 1512 if(pFormShell) 1513 pFormShell->SetY2KState(nYear2K); 1514 pVFrame = SfxViewFrame::GetNext( *pVFrame, this ); 1515 pViewShell = pVFrame ? pVFrame->GetViewShell() : 0; 1516 pCurrView = dynamic_cast<SwView*>( pViewShell ); 1517 } | 1457 } 1458 //<-end,zhaojianwei 1459 if( bDone ) 1460 { 1461 SfxStringItem aName( SID_FILE_NAME, aFileName ); 1462 SfxStringItem aReferer( SID_REFERER, aEmptyStr ); 1463 SfxViewShell* pViewShell = SfxViewShell::GetFirst(); 1464 while(pViewShell) --- 45 unchanged lines hidden (view full) --- 1510 { 1511 FmFormShell* pFormShell = pCurrView->GetFormShell(); 1512 if(pFormShell) 1513 pFormShell->SetY2KState(nYear2K); 1514 pVFrame = SfxViewFrame::GetNext( *pVFrame, this ); 1515 pViewShell = pVFrame ? pVFrame->GetViewShell() : 0; 1516 pCurrView = dynamic_cast<SwView*>( pViewShell ); 1517 } |
1518 pDoc->GetNumberFormatter(sal_True)->SetYear2000(nYear2K); | 1518 mpDoc->GetNumberFormatter(sal_True)->SetYear2000(nYear2K); |
1519 } 1520 break; 1521 1522 default: DBG_ERROR("falscher Dispatcher"); 1523 } 1524} 1525 1526 1527/*-------------------------------------------------------------------- 1528 Beschreibung: 1529 --------------------------------------------------------------------*/ 1530 1531long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType, 1532 uno::Any & rValue ) 1533{ | 1519 } 1520 break; 1521 1522 default: DBG_ERROR("falscher Dispatcher"); 1523 } 1524} 1525 1526 1527/*-------------------------------------------------------------------- 1528 Beschreibung: 1529 --------------------------------------------------------------------*/ 1530 1531long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType, 1532 uno::Any & rValue ) 1533{ |
1534 return pDoc->GetData( rItem, rMimeType, rValue ); | 1534 return mpDoc->GetData( rItem, rMimeType, rValue ); |
1535} 1536 1537 1538/*-------------------------------------------------------------------- 1539 Beschreibung: 1540 --------------------------------------------------------------------*/ 1541 1542long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType, 1543 const uno::Any & rValue ) 1544{ | 1535} 1536 1537 1538/*-------------------------------------------------------------------- 1539 Beschreibung: 1540 --------------------------------------------------------------------*/ 1541 1542long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType, 1543 const uno::Any & rValue ) 1544{ |
1545 return pDoc->SetData( rItem, rMimeType, rValue ); | 1545 return mpDoc->SetData( rItem, rMimeType, rValue ); |
1546} 1547 1548 1549/*-------------------------------------------------------------------- 1550 Beschreibung: 1551 --------------------------------------------------------------------*/ 1552 1553::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const String& rItem ) 1554{ | 1546} 1547 1548 1549/*-------------------------------------------------------------------- 1550 Beschreibung: 1551 --------------------------------------------------------------------*/ 1552 1553::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const String& rItem ) 1554{ |
1555 return pDoc->CreateLinkSource( rItem ); | 1555 return mpDoc->CreateLinkSource( rItem ); |
1556} 1557 1558/*-------------------------------------------------------------------- 1559 Beschreibung: 1560 --------------------------------------------------------------------*/ 1561 1562void SwDocShell::FillClass( SvGlobalName * pClassName, 1563 sal_uInt32 * pClipFormat, --- 24 unchanged lines hidden (view full) --- 1588 Beschreibung: 1589 --------------------------------------------------------------------*/ 1590 1591void SwDocShell::SetModified( sal_Bool bSet ) 1592{ 1593 SfxObjectShell::SetModified( bSet ); 1594 if( IsEnableSetModified()) 1595 { | 1556} 1557 1558/*-------------------------------------------------------------------- 1559 Beschreibung: 1560 --------------------------------------------------------------------*/ 1561 1562void SwDocShell::FillClass( SvGlobalName * pClassName, 1563 sal_uInt32 * pClipFormat, --- 24 unchanged lines hidden (view full) --- 1588 Beschreibung: 1589 --------------------------------------------------------------------*/ 1590 1591void SwDocShell::SetModified( sal_Bool bSet ) 1592{ 1593 SfxObjectShell::SetModified( bSet ); 1594 if( IsEnableSetModified()) 1595 { |
1596 if (!pDoc->IsInCallModified() ) | 1596 if (!mpDoc->IsInCallModified() ) |
1597 { 1598 EnableSetModified( sal_False ); 1599 if( bSet ) 1600 { | 1597 { 1598 EnableSetModified( sal_False ); 1599 if( bSet ) 1600 { |
1601 sal_Bool bOld = pDoc->IsModified(); 1602 pDoc->SetModified(); | 1601 sal_Bool bOld = mpDoc->IsModified(); 1602 mpDoc->SetModified(); |
1603 if( !bOld ) 1604 { | 1603 if( !bOld ) 1604 { |
1605 pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); | 1605 mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); |
1606 } 1607 } 1608 else | 1606 } 1607 } 1608 else |
1609 pDoc->ResetModified(); | 1609 mpDoc->ResetModified(); |
1610 1611 EnableSetModified( sal_True ); 1612 } 1613 1614 UpdateChildWindows(); 1615 Broadcast(SfxSimpleHint(SFX_HINT_DOCCHANGED)); 1616 } 1617} --- 76 unchanged lines hidden (view full) --- 1694 pBasic->Clear(); 1695 } 1696 } 1697 1698 ASSERT( pBasicMan->GetLibCount() <= 1, 1699 "Loschen des Basics hat nicht geklappt" ); 1700 } 1701 } | 1610 1611 EnableSetModified( sal_True ); 1612 } 1613 1614 UpdateChildWindows(); 1615 Broadcast(SfxSimpleHint(SFX_HINT_DOCCHANGED)); 1616 } 1617} --- 76 unchanged lines hidden (view full) --- 1694 pBasic->Clear(); 1695 } 1696 } 1697 1698 ASSERT( pBasicMan->GetLibCount() <= 1, 1699 "Loschen des Basics hat nicht geklappt" ); 1700 } 1701 } |
1702 sal_Bool bWasBrowseMode = pDoc->get(IDocumentSettingAccess::BROWSE_MODE); | 1702 sal_Bool bWasBrowseMode = mpDoc->get(IDocumentSettingAccess::BROWSE_MODE); |
1703 RemoveLink(); 1704 1705 //jetzt muss auch das UNO-Model ueber das neue Doc informiert werden #51535# 1706 uno::Reference<text::XTextDocument> xDoc(GetBaseModel(), uno::UNO_QUERY); 1707 text::XTextDocument* pxDoc = xDoc.get(); 1708 ((SwXTextDocument*)pxDoc)->InitNewDoc(); 1709 1710 AddLink(); 1711 //#116402# update font list when new document is created 1712 UpdateFontList(); | 1703 RemoveLink(); 1704 1705 //jetzt muss auch das UNO-Model ueber das neue Doc informiert werden #51535# 1706 uno::Reference<text::XTextDocument> xDoc(GetBaseModel(), uno::UNO_QUERY); 1707 text::XTextDocument* pxDoc = xDoc.get(); 1708 ((SwXTextDocument*)pxDoc)->InitNewDoc(); 1709 1710 AddLink(); 1711 //#116402# update font list when new document is created 1712 UpdateFontList(); |
1713 pDoc->set(IDocumentSettingAccess::BROWSE_MODE, bWasBrowseMode); | 1713 mpDoc->set(IDocumentSettingAccess::BROWSE_MODE, bWasBrowseMode); |
1714 pSrcView->SetPool(&GetPool()); 1715 1716 1717 const String& rMedname = GetMedium()->GetName(); 1718 1719 // fix #51032#: Die HTML-Vorlage muss noch gesetzt werden 1720 SetHTMLTemplate( *GetDoc() ); //Styles aus HTML.vor 1721 --- 4 unchanged lines hidden (view full) --- 1726 1727 SubInitNew(); 1728 1729 SfxMedium aMed( rStreamName, STREAM_READ, sal_False ); 1730 // --> OD 2005-08-01 #i48748# - use class <SwReloadFromHtmlReader>, because 1731 // the base URL has to be set to the filename of the document <rMedname> 1732 // and not to the base URL of the temporary file <aMed> in order to get 1733 // the URLs of the linked graphics correctly resolved. | 1714 pSrcView->SetPool(&GetPool()); 1715 1716 1717 const String& rMedname = GetMedium()->GetName(); 1718 1719 // fix #51032#: Die HTML-Vorlage muss noch gesetzt werden 1720 SetHTMLTemplate( *GetDoc() ); //Styles aus HTML.vor 1721 --- 4 unchanged lines hidden (view full) --- 1726 1727 SubInitNew(); 1728 1729 SfxMedium aMed( rStreamName, STREAM_READ, sal_False ); 1730 // --> OD 2005-08-01 #i48748# - use class <SwReloadFromHtmlReader>, because 1731 // the base URL has to be set to the filename of the document <rMedname> 1732 // and not to the base URL of the temporary file <aMed> in order to get 1733 // the URLs of the linked graphics correctly resolved. |
1734 SwReloadFromHtmlReader aReader( aMed, rMedname, pDoc ); | 1734 SwReloadFromHtmlReader aReader( aMed, rMedname, mpDoc ); |
1735 // <-- 1736 aReader.Read( *ReadHTML ); 1737 1738 const SwView* pCurrView = GetView(); 1739 //in print layout the first page(s) may have been formatted as a mix of browse 1740 //and print layout 1741 if(!bWasBrowseMode && pCurrView) 1742 { --- 6 unchanged lines hidden (view full) --- 1749 // MIB 23.6.97: Die HTTP-Header-Attribute wieder in die DokInfo 1750 // uebernehmen. Die Base-URL ist hier egal, da TLX zum absolutieren die 1751 // vom Dokument nimmt. 1752 SetHeaderAttributesForSourceViewHack(); 1753 1754 if(bModified && !IsReadOnly()) 1755 SetModified(); 1756 else | 1735 // <-- 1736 aReader.Read( *ReadHTML ); 1737 1738 const SwView* pCurrView = GetView(); 1739 //in print layout the first page(s) may have been formatted as a mix of browse 1740 //and print layout 1741 if(!bWasBrowseMode && pCurrView) 1742 { --- 6 unchanged lines hidden (view full) --- 1749 // MIB 23.6.97: Die HTTP-Header-Attribute wieder in die DokInfo 1750 // uebernehmen. Die Base-URL ist hier egal, da TLX zum absolutieren die 1751 // vom Dokument nimmt. 1752 SetHeaderAttributesForSourceViewHack(); 1753 1754 if(bModified && !IsReadOnly()) 1755 SetModified(); 1756 else |
1757 pDoc->ResetModified(); | 1757 mpDoc->ResetModified(); |
1758} 1759 1760sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, 1761 SwgReaderOption& rOpt, sal_Bool bUnoCall ) 1762{ 1763 sal_uLong nErr = 0; 1764 1765 // Create a URL from filename --- 49 unchanged lines hidden (view full) --- 1815 DBG_ASSERT((pFlt ? pFlt->GetVersion() : 0) >= SOFFICE_FILEFORMAT_60, "which file version?"); 1816 SwRead pRead = ReadXML; 1817 SwReader* pReader = 0; 1818 SwPaM* pPam = 0; 1819 // the SW3IO - Reader need the pam/wrtshell, because only then he 1820 // insert the styles! 1821 if( bUnoCall ) 1822 { | 1758} 1759 1760sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, 1761 SwgReaderOption& rOpt, sal_Bool bUnoCall ) 1762{ 1763 sal_uLong nErr = 0; 1764 1765 // Create a URL from filename --- 49 unchanged lines hidden (view full) --- 1815 DBG_ASSERT((pFlt ? pFlt->GetVersion() : 0) >= SOFFICE_FILEFORMAT_60, "which file version?"); 1816 SwRead pRead = ReadXML; 1817 SwReader* pReader = 0; 1818 SwPaM* pPam = 0; 1819 // the SW3IO - Reader need the pam/wrtshell, because only then he 1820 // insert the styles! 1821 if( bUnoCall ) 1822 { |
1823 SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfContent(), -1 ); | 1823 SwNodeIndex aIdx( mpDoc->GetNodes().GetEndOfContent(), -1 ); |
1824 pPam = new SwPaM( aIdx ); 1825 pReader = new SwReader( aMed, rURL, *pPam ); 1826 } 1827 else 1828 { | 1824 pPam = new SwPaM( aIdx ); 1825 pReader = new SwReader( aMed, rURL, *pPam ); 1826 } 1827 else 1828 { |
1829 pReader = new SwReader( aMed, rURL, *pWrtShell->GetCrsr() ); | 1829 pReader = new SwReader( aMed, rURL, *mpWrtShell->GetCrsr() ); |
1830 } 1831 1832 pRead->GetReaderOpt().SetTxtFmts( rOpt.IsTxtFmts() ); 1833 pRead->GetReaderOpt().SetFrmFmts( rOpt.IsFrmFmts() ); 1834 pRead->GetReaderOpt().SetPageDescs( rOpt.IsPageDescs() ); 1835 pRead->GetReaderOpt().SetNumRules( rOpt.IsNumRules() ); 1836 pRead->GetReaderOpt().SetMerge( rOpt.IsMerge() ); 1837 1838 if( bUnoCall ) 1839 { | 1830 } 1831 1832 pRead->GetReaderOpt().SetTxtFmts( rOpt.IsTxtFmts() ); 1833 pRead->GetReaderOpt().SetFrmFmts( rOpt.IsFrmFmts() ); 1834 pRead->GetReaderOpt().SetPageDescs( rOpt.IsPageDescs() ); 1835 pRead->GetReaderOpt().SetNumRules( rOpt.IsNumRules() ); 1836 pRead->GetReaderOpt().SetMerge( rOpt.IsMerge() ); 1837 1838 if( bUnoCall ) 1839 { |
1840 UnoActionContext aAction( pDoc ); | 1840 UnoActionContext aAction( mpDoc ); |
1841 nErr = pReader->Read( *pRead ); 1842 } 1843 else 1844 { | 1841 nErr = pReader->Read( *pRead ); 1842 } 1843 else 1844 { |
1845 pWrtShell->StartAllAction(); | 1845 mpWrtShell->StartAllAction(); |
1846 nErr = pReader->Read( *pRead ); | 1846 nErr = pReader->Read( *pRead ); |
1847 pWrtShell->EndAllAction(); | 1847 mpWrtShell->EndAllAction(); |
1848 } 1849 delete pPam; 1850 delete pReader; 1851 } 1852 1853 return nErr; 1854} 1855 --- 18 unchanged lines hidden --- | 1848 } 1849 delete pPam; 1850 delete pReader; 1851 } 1852 1853 return nErr; 1854} 1855 --- 18 unchanged lines hidden --- |