sdmod2.cxx (30acf5e8) | sdmod2.cxx (579128bd) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 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 9 * with the License. You may obtain a copy of the License at | 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 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_sd.hxx" 26#include <editeng/eeitem.hxx> 27#include <editeng/flditem.hxx> --- 17 unchanged lines hidden (view full) --- 45#include <svx/svdpagv.hxx> 46#include <svx/svdopage.hxx> 47 48#include <sfx2/sfxdlg.hxx> 49 50 51#include <svx/sdr/contact/displayinfo.hxx> 52 | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_sd.hxx" 26#include <editeng/eeitem.hxx> 27#include <editeng/flditem.hxx> --- 17 unchanged lines hidden (view full) --- 45#include <svx/svdpagv.hxx> 46#include <svx/svdopage.hxx> 47 48#include <sfx2/sfxdlg.hxx> 49 50 51#include <svx/sdr/contact/displayinfo.hxx> 52 |
53#define _SD_DLL // fuer SD_MOD() | 53#define _SD_DLL // fuer SD_MOD() |
54#include "sdmod.hxx" 55#include "sddll.hxx" 56#include "app.hrc" 57#include "glob.hrc" 58#include "strings.hrc" 59#include "res_bmp.hrc" 60#include "ViewShell.hxx" 61#ifndef SD_FRAMW_VIEW_HXX --- 37 unchanged lines hidden (view full) --- 99 return pPage; 100 } 101 102 // first try to check if we are inside the outline view 103 sd::OutlineView* pSdView = NULL; 104 if( pViewSh && pViewSh->ISA(sd::OutlineViewShell)) 105 pSdView = static_cast<sd::OutlineView*> (static_cast<sd::OutlineViewShell*>(pViewSh)->GetView()); 106 | 54#include "sdmod.hxx" 55#include "sddll.hxx" 56#include "app.hrc" 57#include "glob.hrc" 58#include "strings.hrc" 59#include "res_bmp.hrc" 60#include "ViewShell.hxx" 61#ifndef SD_FRAMW_VIEW_HXX --- 37 unchanged lines hidden (view full) --- 99 return pPage; 100 } 101 102 // first try to check if we are inside the outline view 103 sd::OutlineView* pSdView = NULL; 104 if( pViewSh && pViewSh->ISA(sd::OutlineViewShell)) 105 pSdView = static_cast<sd::OutlineView*> (static_cast<sd::OutlineViewShell*>(pViewSh)->GetView()); 106 |
107 if (pSdView != NULL && (pOutliner == pSdView->GetOutliner())) 108 { 109 // outline mode 110 int nPgNum = 0; 111 Outliner* pOutl = pSdView->GetOutliner(); 112 long nPos = pInfo->GetPara(); 113 sal_uLong nParaPos = 0; | 107 if (pSdView != NULL && (pOutliner == pSdView->GetOutliner())) 108 { 109 // outline mode 110 int nPgNum = 0; 111 Outliner* pOutl = pSdView->GetOutliner(); 112 long nPos = pInfo->GetPara(); 113 sal_uLong nParaPos = 0; |
114 | 114 |
115 for( Paragraph* pPara = pOutl->GetParagraph( 0 ); pPara && nPos >= 0; pPara = pOutl->GetParagraph( ++nParaPos ), nPos-- ) 116 { 117 if( pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) ) 118 nPgNum++; 119 } | 115 for( Paragraph* pPara = pOutl->GetParagraph( 0 ); pPara && nPos >= 0; pPara = pOutl->GetParagraph( ++nParaPos ), nPos-- ) 116 { 117 if( pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) ) 118 nPgNum++; 119 } |
120 121 pPage = pViewSh->GetDoc()->GetSdPage( (sal_uInt16)nPgNum, PK_STANDARD ); 122 } 123 else 124 { 125 // draw mode, slide mode and preview. Get the processed page from the outliner 126 if(pOutliner) 127 { 128 pPage = dynamic_cast< SdPage* >(const_cast< SdrPage* >(pOutliner->getVisualizedPage())); 129 } 130 131 // The path using GetPaintingPageView() and GetCurrentPaintingDisplayInfo() 132 // is no longer needed. I debugged and checked all usages of PageNumber decompositions 133 // which all use the new possibility of setting the visualized page at the SdrOutliner. 134 | 120 121 pPage = pViewSh->GetDoc()->GetSdPage( (sal_uInt16)nPgNum, PK_STANDARD ); 122 } 123 else 124 { 125 // draw mode, slide mode and preview. Get the processed page from the outliner 126 if(pOutliner) 127 { 128 pPage = dynamic_cast< SdPage* >(const_cast< SdrPage* >(pOutliner->getVisualizedPage())); 129 } 130 131 // The path using GetPaintingPageView() and GetCurrentPaintingDisplayInfo() 132 // is no longer needed. I debugged and checked all usages of PageNumber decompositions 133 // which all use the new possibility of setting the visualized page at the SdrOutliner. 134 |
135 // if all else failed, geht the current page from the object that is | 135 // if all else failed, get the current page from the object that is |
136 // currently formatted from the document 137 if(!pPage) 138 { 139 const SdrTextObj* pTextObj = (pViewSh && pViewSh->GetDoc()) ? pViewSh->GetDoc()->GetFormattingTextObj() : NULL; 140 141 if( pTextObj ) 142 { 143 pPage = dynamic_cast< SdPage* >( pTextObj->GetPage() ); --- 5 unchanged lines hidden (view full) --- 149 bMasterView = pPage && pPage->IsMasterPage(); 150 } 151 } 152 153 return pPage; 154} 155 156/************************************************************************* | 136 // currently formatted from the document 137 if(!pPage) 138 { 139 const SdrTextObj* pTextObj = (pViewSh && pViewSh->GetDoc()) ? pViewSh->GetDoc()->GetFormattingTextObj() : NULL; 140 141 if( pTextObj ) 142 { 143 pPage = dynamic_cast< SdPage* >( pTextObj->GetPage() ); --- 5 unchanged lines hidden (view full) --- 149 bMasterView = pPage && pPage->IsMasterPage(); 150 } 151 } 152 153 return pPage; 154} 155 156/************************************************************************* |
157|* | |
158|* Link fuer CalcFieldValue des Outliners | 157|* Link fuer CalcFieldValue des Outliners |
159|* | |
160\************************************************************************/ 161 162IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) 163{ 164 if (pInfo) 165 { 166 const SvxFieldData* pField = pInfo->GetField().GetField(); | 158\************************************************************************/ 159 160IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) 161{ 162 if (pInfo) 163 { 164 const SvxFieldData* pField = pInfo->GetField().GetField(); |
167 ::sd::DrawDocShell* pDocShell = NULL; | 165 ::sd::DrawDocShell* pDocShell = NULL; |
168 SdDrawDocument* pDoc = 0; 169 170 SdrOutliner* pSdrOutliner = dynamic_cast< SdrOutliner* >( pInfo->GetOutliner() ); | 166 SdDrawDocument* pDoc = 0; 167 168 SdrOutliner* pSdrOutliner = dynamic_cast< SdrOutliner* >( pInfo->GetOutliner() ); |
171 if( pSdrOutliner ) 172 { 173 const SdrTextObj* pTextObj = pSdrOutliner->GetTextObj(); | 169 if( pSdrOutliner ) 170 { 171 const SdrTextObj* pTextObj = pSdrOutliner->GetTextObj(); |
174 175 if( pTextObj ) 176 pDoc = dynamic_cast< SdDrawDocument* >( pTextObj->GetModel() ); 177 178 if( pDoc ) | 172 173 if( pTextObj ) 174 pDoc = dynamic_cast< SdDrawDocument* >( pTextObj->GetModel() ); 175 176 if( pDoc ) |
179 pDocShell = pDoc->GetDocSh(); 180 } | 177 pDocShell = pDoc->GetDocSh(); 178 } |
181 | 179 |
182 if( !pDocShell ) 183 pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); | 180 if( !pDocShell ) 181 pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); |
184 185 const SvxDateField* pDateField = 0; 186 const SvxExtTimeField* pExtTimeField = 0; 187 const SvxExtFileField* pExtFileField = 0; 188 const SvxAuthorField* pAuthorField = 0; 189 const SvxURLField* pURLField = 0; 190 191 if( (pDateField = dynamic_cast< const SvxDateField* >(pField)) != 0 ) --- 16 unchanged lines hidden (view full) --- 208 else 209 aName = pDocShell->GetName(); 210 211 const_cast< SvxExtFileField* >(pExtFileField)->SetFile( aName ); 212 } 213 pInfo->SetRepresentation( pExtFileField->GetFormatted() ); 214 215 } | 182 183 const SvxDateField* pDateField = 0; 184 const SvxExtTimeField* pExtTimeField = 0; 185 const SvxExtFileField* pExtFileField = 0; 186 const SvxAuthorField* pAuthorField = 0; 187 const SvxURLField* pURLField = 0; 188 189 if( (pDateField = dynamic_cast< const SvxDateField* >(pField)) != 0 ) --- 16 unchanged lines hidden (view full) --- 206 else 207 aName = pDocShell->GetName(); 208 209 const_cast< SvxExtFileField* >(pExtFileField)->SetFile( aName ); 210 } 211 pInfo->SetRepresentation( pExtFileField->GetFormatted() ); 212 213 } |
216 else if( (pAuthorField = dynamic_cast< const SvxAuthorField* >( pField )) != 0 ) | 214 else if( (pAuthorField = dynamic_cast< const SvxAuthorField* >( pField )) != 0 ) |
217 { 218 if( pAuthorField->GetType() != SVXAUTHORTYPE_FIX ) 219 { | 215 { 216 if( pAuthorField->GetType() != SVXAUTHORTYPE_FIX ) 217 { |
220 SvtUserOptions aUserOptions; 221 SvxAuthorField aAuthorField( 222 aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID(), 223 pAuthorField->GetType(), pAuthorField->GetFormat() ); | 218 SvtUserOptions aUserOptions; 219 SvxAuthorField aAuthorField( 220 aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID(), 221 pAuthorField->GetType(), pAuthorField->GetFormat() ); |
224 | 222 |
225 *(const_cast< SvxAuthorField* >(pAuthorField)) = aAuthorField; | 223 *(const_cast< SvxAuthorField* >(pAuthorField)) = aAuthorField; |
226 } 227 pInfo->SetRepresentation( pAuthorField->GetFormatted() ); 228 229 } | 224 } 225 pInfo->SetRepresentation( pAuthorField->GetFormatted() ); 226 227 } |
230 else if( dynamic_cast< const SvxPageField* >(pField) ) | 228 else if( dynamic_cast< const SvxPageField* >(pField) ) |
231 { 232 String aRepresentation; 233 aRepresentation += sal_Unicode( ' ' ); 234 235 ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; 236 if(pViewSh == NULL) | 229 { 230 String aRepresentation; 231 aRepresentation += sal_Unicode( ' ' ); 232 233 ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; 234 if(pViewSh == NULL) |
237 { 238 ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current()); 239 if(pBase) 240 pViewSh = pBase->GetMainViewShell().get(); 241 } | 235 { 236 ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current()); 237 if(pBase) 238 pViewSh = pBase->GetMainViewShell().get(); 239 } |
242 if( !pDoc && pViewSh ) 243 pDoc = pViewSh->GetDoc(); 244 245 bool bMasterView; 246 SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView ); 247 248 if( pPage && pDoc && !bMasterView ) 249 { --- 12 unchanged lines hidden (view full) --- 262 else 263 { 264 static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_NUMBER ) ); 265 aRepresentation = aNumberText; 266 } 267 268 pInfo->SetRepresentation( aRepresentation ); 269 } | 240 if( !pDoc && pViewSh ) 241 pDoc = pViewSh->GetDoc(); 242 243 bool bMasterView; 244 SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView ); 245 246 if( pPage && pDoc && !bMasterView ) 247 { --- 12 unchanged lines hidden (view full) --- 260 else 261 { 262 static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_NUMBER ) ); 263 aRepresentation = aNumberText; 264 } 265 266 pInfo->SetRepresentation( aRepresentation ); 267 } |
270 else if( dynamic_cast< const SvxPagesField* >(pField) ) | 268 else if( dynamic_cast< const SvxPagesField* >(pField) ) |
271 { 272 String aRepresentation; 273 aRepresentation += sal_Unicode( ' ' ); 274 275 ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; 276 if(pViewSh == NULL) | 269 { 270 String aRepresentation; 271 aRepresentation += sal_Unicode( ' ' ); 272 273 ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; 274 if(pViewSh == NULL) |
277 { 278 ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current()); 279 if(pBase) 280 pViewSh = pBase->GetMainViewShell().get(); 281 } | 275 { 276 ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current()); 277 if(pBase) 278 pViewSh = pBase->GetMainViewShell().get(); 279 } |
282 if( !pDoc && pViewSh ) 283 pDoc = pViewSh->GetDoc(); 284 285 bool bMasterView; 286 SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView ); 287 | 280 if( !pDoc && pViewSh ) 281 pDoc = pViewSh->GetDoc(); 282 283 bool bMasterView; 284 SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView ); 285 |
288 sal_uInt16 nPageCount = 0; | 286 sal_uInt16 nPageCount = 0; |
289 | 287 |
290 if( !bMasterView ) 291 { 292 if( pPage && (pPage->GetPageKind() == PK_HANDOUT) && pViewSh ) 293 { 294 nPageCount = pViewSh->GetPrintedHandoutPageCount(); 295 } 296 else if( pDoc ) 297 { 298 nPageCount = (sal_uInt16)pDoc->GetSdPageCount(PK_STANDARD); 299 } 300 } | 288 if( !bMasterView ) 289 { 290 if( pPage && (pPage->GetPageKind() == PK_HANDOUT) && pViewSh ) 291 { 292 nPageCount = pViewSh->GetPrintedHandoutPageCount(); 293 } 294 else if( pDoc ) 295 { 296 nPageCount = (sal_uInt16)pDoc->GetSdPageCount(PK_STANDARD); 297 } 298 } |
301 | 299 |
302 if( nPageCount > 0 ) 303 { | 300 if( nPageCount > 0 ) 301 { |
304 aRepresentation = pDoc->CreatePageNumValue(nPageCount); 305 } 306 else 307 { 308 static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_COUNT ) ); 309 aRepresentation = aNumberText; 310 } 311 --- 10 unchanged lines hidden (view full) --- 322 323 case SVXURLFORMAT_URL: 324 pInfo->SetRepresentation( pURLField->GetURL() ); 325 break; 326 } 327 328 String aURL = pURLField->GetURL(); 329 | 302 aRepresentation = pDoc->CreatePageNumValue(nPageCount); 303 } 304 else 305 { 306 static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_COUNT ) ); 307 aRepresentation = aNumberText; 308 } 309 --- 10 unchanged lines hidden (view full) --- 320 321 case SVXURLFORMAT_URL: 322 pInfo->SetRepresentation( pURLField->GetURL() ); 323 break; 324 } 325 326 String aURL = pURLField->GetURL(); 327 |
330 svtools::ColorConfig aConfig; 331 svtools::ColorConfigEntry eEntry = 332 INetURLHistory::GetOrCreate()->QueryUrl( aURL ) ? svtools::LINKSVISITED : svtools::LINKS; | 328 svtools::ColorConfig aConfig; 329 svtools::ColorConfigEntry eEntry = 330 INetURLHistory::GetOrCreate()->QueryUrl( aURL ) ? svtools::LINKSVISITED : svtools::LINKS; |
333 pInfo->SetTxtColor( aConfig.GetColorValue(eEntry).nColor ); 334 } 335 else if ( dynamic_cast< const SdrMeasureField* >(pField)) 336 { 337 pInfo->ClearFldColor(); 338 } 339 else 340 { --- 55 unchanged lines hidden (view full) --- 396 } 397 } 398 } 399 else 400 { 401 DBG_ERROR("sd::SdModule::CalcFieldValueHdl(), unknown field type!"); 402 } 403 | 331 pInfo->SetTxtColor( aConfig.GetColorValue(eEntry).nColor ); 332 } 333 else if ( dynamic_cast< const SdrMeasureField* >(pField)) 334 { 335 pInfo->ClearFldColor(); 336 } 337 else 338 { --- 55 unchanged lines hidden (view full) --- 394 } 395 } 396 } 397 else 398 { 399 DBG_ERROR("sd::SdModule::CalcFieldValueHdl(), unknown field type!"); 400 } 401 |
404 if( aRepresentation.Len() == 0 ) // TODO: Edit engine doesn't handle empty fields? | 402 if( aRepresentation.Len() == 0 ) // TODO: Edit engine doesn't handle empty fields? |
405 aRepresentation += sal_Unicode( ' ' ); 406 pInfo->SetRepresentation( aRepresentation ); 407 } 408 } 409 410 return(0); 411} 412 413 414 415/************************************************************************* | 403 aRepresentation += sal_Unicode( ' ' ); 404 pInfo->SetRepresentation( aRepresentation ); 405 } 406 } 407 408 return(0); 409} 410 411 412 413/************************************************************************* |
416|* | |
417|* virt. Methoden fuer Optionendialog | 414|* virt. Methoden fuer Optionendialog |
418|* | |
419\************************************************************************/ 420SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot ) 421{ 422 ::sd::FrameView* pFrameView = NULL; 423 ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); 424 SdDrawDocument* pDoc = NULL; 425 426 // Hier wird der DocType vom Optionsdialog gesetzt (nicht Dokument!) --- 9 unchanged lines hidden (view full) --- 436 437 // Wenn der Optionsdialog zum Dokumenttyp identisch ist, 438 // kann auch die FrameView mit uebergeben werden: 439 if( pDoc && eDocType == pDoc->GetDocumentType() ) 440 pFrameView = pDocSh->GetFrameView(); 441 442 pViewShell = pDocSh->GetViewShell(); 443 if (pViewShell != NULL) | 415\************************************************************************/ 416SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot ) 417{ 418 ::sd::FrameView* pFrameView = NULL; 419 ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); 420 SdDrawDocument* pDoc = NULL; 421 422 // Hier wird der DocType vom Optionsdialog gesetzt (nicht Dokument!) --- 9 unchanged lines hidden (view full) --- 432 433 // Wenn der Optionsdialog zum Dokumenttyp identisch ist, 434 // kann auch die FrameView mit uebergeben werden: 435 if( pDoc && eDocType == pDoc->GetDocumentType() ) 436 pFrameView = pDocSh->GetFrameView(); 437 438 pViewShell = pDocSh->GetViewShell(); 439 if (pViewShell != NULL) |
444 pViewShell->WriteFrameViewData(); | 440 pViewShell->WriteFrameViewData(); |
445 } 446 447 SdOptions* pOptions = GetSdOptions(eDocType); 448 449 // Pool hat standardmaessig MapUnit Twips (Baeh!) 450 SfxItemPool& rPool = GetPool(); 451 rPool.SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); 452 --- 34 unchanged lines hidden (view full) --- 487 nMetric = GetFieldUnit(); 488 489 pRet->Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nMetric ) ); 490 491 // TP_OPTIONS_CONTENTS: 492 pRet->Put( SdOptionsContentsItem( ATTR_OPTIONS_CONTENTS, pOptions, pFrameView ) ); 493 494 // TP_OPTIONS_MISC: | 441 } 442 443 SdOptions* pOptions = GetSdOptions(eDocType); 444 445 // Pool hat standardmaessig MapUnit Twips (Baeh!) 446 SfxItemPool& rPool = GetPool(); 447 rPool.SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); 448 --- 34 unchanged lines hidden (view full) --- 483 nMetric = GetFieldUnit(); 484 485 pRet->Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nMetric ) ); 486 487 // TP_OPTIONS_CONTENTS: 488 pRet->Put( SdOptionsContentsItem( ATTR_OPTIONS_CONTENTS, pOptions, pFrameView ) ); 489 490 // TP_OPTIONS_MISC: |
495 SdOptionsMiscItem aSdOptionsMiscItem( ATTR_OPTIONS_MISC, pOptions, pFrameView ); 496 if ( pFrameView ) 497 { 498 aSdOptionsMiscItem.GetOptionsMisc().SetSummationOfParagraphs( pDoc->IsSummationOfParagraphs() ); 499 aSdOptionsMiscItem.GetOptionsMisc().SetPrinterIndependentLayout ( 500 (sal_uInt16)pDoc->GetPrinterIndependentLayout()); 501 } | 491 SdOptionsMiscItem aSdOptionsMiscItem( ATTR_OPTIONS_MISC, pOptions, pFrameView ); 492 if ( pFrameView ) 493 { 494 aSdOptionsMiscItem.GetOptionsMisc().SetSummationOfParagraphs( pDoc->IsSummationOfParagraphs() ); 495 aSdOptionsMiscItem.GetOptionsMisc().SetPrinterIndependentLayout ( 496 (sal_uInt16)pDoc->GetPrinterIndependentLayout()); 497 } |
502 pRet->Put( aSdOptionsMiscItem ); 503 504 505 // TP_OPTIONS_SNAP: 506 pRet->Put( SdOptionsSnapItem( ATTR_OPTIONS_SNAP, pOptions, pFrameView ) ); 507 508 // TP_SCALE: 509 sal_uInt32 nW = 10L; --- 5 unchanged lines hidden (view full) --- 515 SdrPage* pPage = (SdrPage*) pDoc->GetSdPage(0, PK_STANDARD); 516 Size aSize(pPage->GetSize()); 517 nW = aSize.Width(); 518 nH = aSize.Height(); 519 } 520 521 if(pFrameView) 522 { | 498 pRet->Put( aSdOptionsMiscItem ); 499 500 501 // TP_OPTIONS_SNAP: 502 pRet->Put( SdOptionsSnapItem( ATTR_OPTIONS_SNAP, pOptions, pFrameView ) ); 503 504 // TP_SCALE: 505 sal_uInt32 nW = 10L; --- 5 unchanged lines hidden (view full) --- 511 SdrPage* pPage = (SdrPage*) pDoc->GetSdPage(0, PK_STANDARD); 512 Size aSize(pPage->GetSize()); 513 nW = aSize.Width(); 514 nH = aSize.Height(); 515 } 516 517 if(pFrameView) 518 { |
523 const Fraction& rFraction = pDoc->GetUIScale(); | 519 const Fraction& rFraction = pDoc->GetUIScale(); |
524 nX=rFraction.GetNumerator(); 525 nY=rFraction.GetDenominator(); 526 } 527 else 528 { 529 // Optionen aus Configdatei holen 530 pOptions->GetScale( nX, nY ); 531 } --- 34 unchanged lines hidden (view full) --- 566 pDoc = pDocSh->GetDoc(); 567 568 // Wenn der Optionsdialog zum Dokumenttyp identisch ist, 569 // kann auch die FrameView mit uebergeben werden: 570 if( pDoc && eDocType == pDoc->GetDocumentType() ) 571 pFrameView = pDocSh->GetFrameView(); 572 573 pViewShell = pDocSh->GetViewShell(); | 520 nX=rFraction.GetNumerator(); 521 nY=rFraction.GetDenominator(); 522 } 523 else 524 { 525 // Optionen aus Configdatei holen 526 pOptions->GetScale( nX, nY ); 527 } --- 34 unchanged lines hidden (view full) --- 562 pDoc = pDocSh->GetDoc(); 563 564 // Wenn der Optionsdialog zum Dokumenttyp identisch ist, 565 // kann auch die FrameView mit uebergeben werden: 566 if( pDoc && eDocType == pDoc->GetDocumentType() ) 567 pFrameView = pDocSh->GetFrameView(); 568 569 pViewShell = pDocSh->GetViewShell(); |
574 if (pViewShell != NULL) 575 pViewShell->WriteFrameViewData(); | 570 if (pViewShell != NULL) 571 pViewShell->WriteFrameViewData(); |
576 } 577 SdOptions* pOptions = GetSdOptions(eDocType); 578 // Raster 579 if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS , 580 sal_False, (const SfxPoolItem**) &pItem )) 581 { 582 const SdOptionsGridItem* pGridItem = (SdOptionsGridItem*) pItem; 583 pGridItem->SetOptions( pOptions ); --- 19 unchanged lines hidden (view full) --- 603 if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_DEFTABSTOP, sal_False, &pItem ) ) 604 { 605 nDefTab = ( (SfxUInt16Item*) pItem )->GetValue(); 606 pOptions->SetDefTab( nDefTab ); 607 608 bNewDefTab = sal_True; 609 } 610 | 572 } 573 SdOptions* pOptions = GetSdOptions(eDocType); 574 // Raster 575 if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS , 576 sal_False, (const SfxPoolItem**) &pItem )) 577 { 578 const SdOptionsGridItem* pGridItem = (SdOptionsGridItem*) pItem; 579 pGridItem->SetOptions( pOptions ); --- 19 unchanged lines hidden (view full) --- 599 if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_DEFTABSTOP, sal_False, &pItem ) ) 600 { 601 nDefTab = ( (SfxUInt16Item*) pItem )->GetValue(); 602 pOptions->SetDefTab( nDefTab ); 603 604 bNewDefTab = sal_True; 605 } 606 |
611 // Massstab 612 if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_X, sal_False, &pItem ) ) 613 { 614 sal_Int32 nX = ( (SfxInt32Item*) pItem )->GetValue(); 615 if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_Y, sal_False, &pItem ) ) 616 { 617 sal_Int32 nY = ( (SfxInt32Item*) pItem )->GetValue(); 618 pOptions->SetScale( nX, nY ); | 607 // Massstab 608 if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_X, sal_False, &pItem ) ) 609 { 610 sal_Int32 nX = ( (SfxInt32Item*) pItem )->GetValue(); 611 if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_Y, sal_False, &pItem ) ) 612 { 613 sal_Int32 nY = ( (SfxInt32Item*) pItem )->GetValue(); 614 pOptions->SetScale( nX, nY ); |
619 | 615 |
620 // #92067# Apply to document only if doc type match 621 if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() ) 622 { 623 pDoc->SetUIScale( Fraction( nX, nY ) ); 624 if( pViewShell ) 625 pViewShell->SetRuler( pViewShell->HasRuler() ); 626 } 627 } 628 } | 616 // #92067# Apply to document only if doc type match 617 if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() ) 618 { 619 pDoc->SetUIScale( Fraction( nX, nY ) ); 620 if( pViewShell ) 621 pViewShell->SetRuler( pViewShell->HasRuler() ); 622 } 623 } 624 } |
629 | 625 |
630 // Contents (Inhalte) | 626 // Contents |
631 const SdOptionsContentsItem* pContentsItem = NULL; 632 if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_CONTENTS, 633 sal_False, (const SfxPoolItem**) &pContentsItem )) 634 { 635 pContentsItem->SetOptions( pOptions ); 636 } 637 | 627 const SdOptionsContentsItem* pContentsItem = NULL; 628 if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_CONTENTS, 629 sal_False, (const SfxPoolItem**) &pContentsItem )) 630 { 631 pContentsItem->SetOptions( pOptions ); 632 } 633 |
638 // Misc (Sonstiges) | 634 // Misc |
639 const SdOptionsMiscItem* pMiscItem = NULL; 640 if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_MISC, 641 sal_False, (const SfxPoolItem**) &pMiscItem )) 642 { 643 pMiscItem->SetOptions( pOptions ); 644 bMiscOptions = sal_True; 645 } 646 --- 18 unchanged lines hidden (view full) --- 665 { 666 pPrintItem->SetOptions( pOptions ); 667 668 // PrintOptionsSet setzen 669 SdOptionsPrintItem aPrintItem( ATTR_OPTIONS_PRINT, pOptions ); 670 SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC ); 671 sal_uInt16 nFlags = 0; 672 | 635 const SdOptionsMiscItem* pMiscItem = NULL; 636 if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_MISC, 637 sal_False, (const SfxPoolItem**) &pMiscItem )) 638 { 639 pMiscItem->SetOptions( pOptions ); 640 bMiscOptions = sal_True; 641 } 642 --- 18 unchanged lines hidden (view full) --- 661 { 662 pPrintItem->SetOptions( pOptions ); 663 664 // PrintOptionsSet setzen 665 SdOptionsPrintItem aPrintItem( ATTR_OPTIONS_PRINT, pOptions ); 666 SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC ); 667 sal_uInt16 nFlags = 0; 668 |
673 nFlags = (aPrintItem.GetOptionsPrint().IsWarningSize() ? SFX_PRINTER_CHG_SIZE : 0) | 674 (aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SFX_PRINTER_CHG_ORIENTATION : 0); | 669 nFlags = (aPrintItem.GetOptionsPrint().IsWarningSize() ? SFX_PRINTER_CHG_SIZE : 0) | 670 (aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SFX_PRINTER_CHG_ORIENTATION : 0); |
675 aFlagItem.SetValue( nFlags ); 676 677 aPrintSet.Put( aPrintItem ); 678 aPrintSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) ); 679 aPrintSet.Put( aFlagItem ); 680 681 bNewPrintOptions = sal_True; 682 } 683 684 // Nur, wenn auch der Dokumenttyp uebereinstimmt... 685 if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() ) 686 { 687 if( bNewPrintOptions ) 688 { 689 pDocSh->GetPrinter(sal_True)->SetOptions( aPrintSet ); 690 } 691 | 671 aFlagItem.SetValue( nFlags ); 672 673 aPrintSet.Put( aPrintItem ); 674 aPrintSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) ); 675 aPrintSet.Put( aFlagItem ); 676 677 bNewPrintOptions = sal_True; 678 } 679 680 // Nur, wenn auch der Dokumenttyp uebereinstimmt... 681 if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() ) 682 { 683 if( bNewPrintOptions ) 684 { 685 pDocSh->GetPrinter(sal_True)->SetOptions( aPrintSet ); 686 } 687 |
692 // Am Model den DefTab setzen | 688 // Am Modell den DefTab setzen |
693 if( bNewDefTab ) 694 { 695 SdDrawDocument* pDocument = pDocSh->GetDoc(); 696 pDocument->SetDefaultTabulator( nDefTab ); 697 698 ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False ); 699 if( pOutl ) 700 pOutl->SetDefTab( nDefTab ); 701 702 ::sd::Outliner* pInternalOutl = pDocument->GetInternalOutliner( sal_False ); 703 if( pInternalOutl ) 704 pInternalOutl->SetDefTab( nDefTab ); 705 } 706 if ( bMiscOptions ) 707 { | 689 if( bNewDefTab ) 690 { 691 SdDrawDocument* pDocument = pDocSh->GetDoc(); 692 pDocument->SetDefaultTabulator( nDefTab ); 693 694 ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False ); 695 if( pOutl ) 696 pOutl->SetDefTab( nDefTab ); 697 698 ::sd::Outliner* pInternalOutl = pDocument->GetInternalOutliner( sal_False ); 699 if( pInternalOutl ) 700 pInternalOutl->SetDefTab( nDefTab ); 701 } 702 if ( bMiscOptions ) 703 { |
708 pDoc->SetSummationOfParagraphs( pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() ); | 704 pDoc->SetSummationOfParagraphs( pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() ); |
709 sal_uInt32 nSum = pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() ? EE_CNTRL_ULSPACESUMMATION : 0; 710 sal_uInt32 nCntrl; 711 712 SdDrawDocument* pDocument = pDocSh->GetDoc(); 713 SdrOutliner& rOutl = pDocument->GetDrawOutliner( NULL ); 714 nCntrl = rOutl.GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; 715 rOutl.SetControlWord( nCntrl | nSum ); 716 ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False ); --- 4 unchanged lines hidden (view full) --- 721 } 722 pOutl = pDocument->GetInternalOutliner( sal_False ); 723 if( pOutl ) 724 { 725 nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; 726 pOutl->SetControlWord( nCntrl | nSum ); 727 } 728 | 705 sal_uInt32 nSum = pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() ? EE_CNTRL_ULSPACESUMMATION : 0; 706 sal_uInt32 nCntrl; 707 708 SdDrawDocument* pDocument = pDocSh->GetDoc(); 709 SdrOutliner& rOutl = pDocument->GetDrawOutliner( NULL ); 710 nCntrl = rOutl.GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; 711 rOutl.SetControlWord( nCntrl | nSum ); 712 ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False ); --- 4 unchanged lines hidden (view full) --- 717 } 718 pOutl = pDocument->GetInternalOutliner( sal_False ); 719 if( pOutl ) 720 { 721 nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION; 722 pOutl->SetControlWord( nCntrl | nSum ); 723 } 724 |
729 // Set printer independent layout mode. | 725 // Set printer independent layout mode. |
730 if( pDoc->GetPrinterIndependentLayout() != pMiscItem->GetOptionsMisc().GetPrinterIndependentLayout() ) | 726 if( pDoc->GetPrinterIndependentLayout() != pMiscItem->GetOptionsMisc().GetPrinterIndependentLayout() ) |
731 pDoc->SetPrinterIndependentLayout (pMiscItem->GetOptionsMisc().GetPrinterIndependentLayout()); | 727 pDoc->SetPrinterIndependentLayout (pMiscItem->GetOptionsMisc().GetPrinterIndependentLayout()); |
732 } 733 } 734 735 pOptions->StoreConfig(); 736 737 // Nur, wenn auch der Dokumenttyp uebereinstimmt... 738 if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() ) 739 { --- 92 unchanged lines hidden --- | 728 } 729 } 730 731 pOptions->StoreConfig(); 732 733 // Nur, wenn auch der Dokumenttyp uebereinstimmt... 734 if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() ) 735 { --- 92 unchanged lines hidden --- |