2000-09-18 11:07:07 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:28:19 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:28:19 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:28:19 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:28:19 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:28:19 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:28:19 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 12:31:55 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
2010-01-08 11:32:51 -06:00
|
|
|
#include <editeng/eeitem.hxx>
|
|
|
|
#include <editeng/flditem.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
#include <sfx2/printer.hxx>
|
2009-10-15 17:05:16 -05:00
|
|
|
#include <svl/inethist.hxx>
|
|
|
|
#include <svl/poolitem.hxx>
|
|
|
|
#include <svl/flagitem.hxx>
|
2009-10-06 00:38:24 -05:00
|
|
|
#include <unotools/useroptions.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
#include <sfx2/docfile.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
|
2010-01-08 11:32:51 -06:00
|
|
|
#include <editeng/measfld.hxx>
|
|
|
|
#include <editeng/editstat.hxx>
|
|
|
|
#include <editeng/editeng.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
#include <svx/dialogs.hrc>
|
|
|
|
#include <svx/svdotext.hxx>
|
|
|
|
#include <svx/svdpagv.hxx>
|
|
|
|
#include <svx/svdopage.hxx>
|
|
|
|
|
2004-02-04 02:53:01 -06:00
|
|
|
#include <sfx2/sfxdlg.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
|
2004-03-30 08:47:59 -06:00
|
|
|
#include <svx/sdr/contact/displayinfo.hxx>
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
#define _SD_DLL // fuer SD_MOD()
|
|
|
|
#include "sdmod.hxx"
|
|
|
|
#include "sddll.hxx"
|
|
|
|
#include "app.hrc"
|
|
|
|
#include "glob.hrc"
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "res_bmp.hrc"
|
2004-01-20 03:37:23 -06:00
|
|
|
#include "ViewShell.hxx"
|
|
|
|
#ifndef SD_FRAMW_VIEW_HXX
|
|
|
|
#include "FrameView.hxx"
|
|
|
|
#endif
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "sdattr.hxx"
|
|
|
|
#include "tpoption.hrc"
|
|
|
|
#include "optsitem.hxx"
|
2004-01-20 03:37:23 -06:00
|
|
|
#include "DrawDocShell.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "drawdoc.hxx"
|
2004-01-20 03:37:23 -06:00
|
|
|
#include "Outliner.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include "pres.hxx"
|
2004-01-20 03:37:23 -06:00
|
|
|
#include "DrawViewShell.hxx"
|
|
|
|
#include "OutlineViewShell.hxx"
|
|
|
|
#include "OutlineView.hxx"
|
2004-07-13 07:48:17 -05:00
|
|
|
#include "ViewShellBase.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "sdpage.hxx"
|
2001-01-19 12:15:28 -06:00
|
|
|
#include "sdxfer.hxx"
|
2006-01-20 02:19:25 -06:00
|
|
|
#include "sdabstdlg.hxx"
|
2004-05-10 09:43:06 -05:00
|
|
|
#include "tpoption.hrc"
|
|
|
|
#include "prntopts.hrc"
|
2009-10-15 17:05:16 -05:00
|
|
|
#include <svl/intitem.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-03-30 08:47:59 -06:00
|
|
|
/** retrieves the page that is currently painted. This will only be the master page
|
|
|
|
if the current drawn view only shows the master page*/
|
|
|
|
static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, bool& bMasterView )
|
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
if( !pInfo )
|
|
|
|
return 0;
|
|
|
|
|
2004-03-30 08:47:59 -06:00
|
|
|
bMasterView = false;
|
2005-10-19 06:24:29 -05:00
|
|
|
SdPage* pPage = dynamic_cast< SdPage* >( pInfo->GetSdrPage() );
|
2006-01-20 02:19:25 -06:00
|
|
|
SdrOutliner* pOutliner = dynamic_cast< SdrOutliner* >( pInfo->GetOutliner() );
|
2004-11-26 12:59:23 -06:00
|
|
|
|
|
|
|
// special case, someone already set the current page on the EditFieldInfo
|
|
|
|
// This is used from the svx::UnoGraphicsExporter f.e.
|
|
|
|
if( pPage )
|
|
|
|
{
|
|
|
|
bMasterView = false;
|
|
|
|
return pPage;
|
|
|
|
}
|
2004-03-30 08:47:59 -06:00
|
|
|
|
|
|
|
// first try to check if we are inside the outline view
|
|
|
|
sd::OutlineView* pSdView = NULL;
|
|
|
|
if( pViewSh && pViewSh->ISA(sd::OutlineViewShell))
|
|
|
|
pSdView = static_cast<sd::OutlineView*> (static_cast<sd::OutlineViewShell*>(pViewSh)->GetView());
|
|
|
|
|
2006-01-20 02:19:25 -06:00
|
|
|
if (pSdView != NULL && (pOutliner == pSdView->GetOutliner()))
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
|
|
|
// outline mode
|
|
|
|
int nPgNum = 0;
|
|
|
|
Outliner* pOutl = pSdView->GetOutliner();
|
|
|
|
long nPos = pInfo->GetPara();
|
|
|
|
ULONG nParaPos = 0;
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-03-30 08:47:59 -06:00
|
|
|
for( Paragraph* pPara = pOutl->GetParagraph( 0 ); pPara && nPos >= 0; pPara = pOutl->GetParagraph( ++nParaPos ), nPos-- )
|
|
|
|
{
|
2008-07-30 08:10:52 -05:00
|
|
|
if( pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
|
2004-03-30 08:47:59 -06:00
|
|
|
nPgNum++;
|
|
|
|
}
|
|
|
|
|
2006-12-12 09:55:19 -06:00
|
|
|
pPage = pViewSh->GetDoc()->GetSdPage( (USHORT)nPgNum, PK_STANDARD );
|
2004-03-30 08:47:59 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-19 18:13:22 -05:00
|
|
|
// draw mode, slide mode and preview. Get the processed page from the outliner
|
|
|
|
if(pOutliner)
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
2008-08-19 18:13:22 -05:00
|
|
|
pPage = dynamic_cast< SdPage* >(const_cast< SdrPage* >(pOutliner->getVisualizedPage()));
|
2004-03-30 08:47:59 -06:00
|
|
|
}
|
|
|
|
|
2008-08-19 18:13:22 -05:00
|
|
|
// The path using GetPaintingPageView() and GetCurrentPaintingDisplayInfo()
|
|
|
|
// is no longer needed. I debugged and checked all usages of PageNumber decompositions
|
|
|
|
// which all use the new possibility of setting the visualized page at the SdrOutliner.
|
2004-03-30 08:47:59 -06:00
|
|
|
|
2008-08-19 18:13:22 -05:00
|
|
|
// if all else failed, geht the current page from the object that is
|
|
|
|
// currently formated from the document
|
|
|
|
if(!pPage)
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
2008-08-19 18:13:22 -05:00
|
|
|
const SdrTextObj* pTextObj = (pViewSh && pViewSh->GetDoc()) ? pViewSh->GetDoc()->GetFormattingTextObj() : NULL;
|
2004-03-30 08:47:59 -06:00
|
|
|
|
2008-08-19 18:13:22 -05:00
|
|
|
if( pTextObj )
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
2008-08-19 18:13:22 -05:00
|
|
|
pPage = dynamic_cast< SdPage* >( pTextObj->GetPage() );
|
2004-03-30 08:47:59 -06:00
|
|
|
}
|
2008-08-19 18:13:22 -05:00
|
|
|
}
|
2004-03-30 08:47:59 -06:00
|
|
|
|
2008-08-19 18:13:22 -05:00
|
|
|
if(pPage)
|
|
|
|
{
|
2004-03-30 08:47:59 -06:00
|
|
|
bMasterView = pPage && pPage->IsMasterPage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return pPage;
|
|
|
|
}
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Link fuer CalcFieldValue des Outliners
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
|
|
|
|
{
|
|
|
|
if (pInfo)
|
|
|
|
{
|
2001-09-27 03:18:28 -05:00
|
|
|
const SvxFieldData* pField = pInfo->GetField().GetField();
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::DrawDocShell* pDocShell = NULL;
|
2006-05-08 09:30:08 -05:00
|
|
|
SdDrawDocument* pDoc = 0;
|
2001-10-26 06:36:13 -05:00
|
|
|
|
|
|
|
if( pInfo->GetOutliner() )
|
|
|
|
{
|
|
|
|
const SdrTextObj* pTextObj = static_cast< SdrOutliner* >( pInfo->GetOutliner() )->GetTextObj();
|
|
|
|
|
2006-01-20 02:19:25 -06:00
|
|
|
if( pTextObj )
|
2006-05-08 09:30:08 -05:00
|
|
|
pDoc = dynamic_cast< SdDrawDocument* >( pTextObj->GetModel() );
|
2006-01-20 02:19:25 -06:00
|
|
|
|
|
|
|
if( pDoc )
|
|
|
|
pDocShell = pDoc->GetDocSh();
|
2001-10-26 06:36:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if( !pDocShell )
|
2006-01-20 02:19:25 -06:00
|
|
|
pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
|
|
|
|
|
|
|
|
const SvxDateField* pDateField = 0;
|
|
|
|
const SvxExtTimeField* pExtTimeField = 0;
|
|
|
|
const SvxExtFileField* pExtFileField = 0;
|
|
|
|
const SvxAuthorField* pAuthorField = 0;
|
|
|
|
const SvxURLField* pURLField = 0;
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-12-12 09:55:19 -06:00
|
|
|
if( (pDateField = dynamic_cast< const SvxDateField* >(pField)) != 0 )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2001-11-23 06:32:36 -06:00
|
|
|
LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
|
2006-01-20 02:19:25 -06:00
|
|
|
pInfo->SetRepresentation( pDateField->GetFormatted( *GetNumberFormatter(), eLang ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2006-12-12 09:55:19 -06:00
|
|
|
else if( (pExtTimeField = dynamic_cast< const SvxExtTimeField *>(pField)) != 0 )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2001-11-23 06:32:36 -06:00
|
|
|
LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
|
2006-01-20 02:19:25 -06:00
|
|
|
pInfo->SetRepresentation( pExtTimeField->GetFormatted( *GetNumberFormatter(), eLang ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2006-12-12 09:55:19 -06:00
|
|
|
else if( (pExtFileField = dynamic_cast< const SvxExtFileField * >(pField)) != 0 )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
if( pDocShell && (pExtFileField->GetType() != SVXFILETYPE_FIX) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2001-10-26 06:36:13 -05:00
|
|
|
String aName;
|
|
|
|
if( pDocShell->HasName() )
|
|
|
|
aName = pDocShell->GetMedium()->GetName();
|
|
|
|
else
|
|
|
|
aName = pDocShell->GetName();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-01-20 02:19:25 -06:00
|
|
|
const_cast< SvxExtFileField* >(pExtFileField)->SetFile( aName );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2006-01-20 02:19:25 -06:00
|
|
|
pInfo->SetRepresentation( pExtFileField->GetFormatted() );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
}
|
2006-12-12 09:55:19 -06:00
|
|
|
else if( (pAuthorField = dynamic_cast< const SvxAuthorField* >( pField )) != 0 )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
if( pAuthorField->GetType() != SVXAUTHORTYPE_FIX )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-04-29 11:03:40 -05:00
|
|
|
SvtUserOptions aUserOptions;
|
|
|
|
SvxAuthorField aAuthorField(
|
|
|
|
aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID(),
|
|
|
|
pAuthorField->GetType(), pAuthorField->GetFormat() );
|
2001-09-27 03:18:28 -05:00
|
|
|
|
|
|
|
*(const_cast< SvxAuthorField* >(pAuthorField)) = aAuthorField;
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2006-01-20 02:19:25 -06:00
|
|
|
pInfo->SetRepresentation( pAuthorField->GetFormatted() );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
}
|
2006-01-20 02:19:25 -06:00
|
|
|
else if( dynamic_cast< const SvxPageField* >(pField) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
String aRepresentation;
|
|
|
|
aRepresentation += sal_Unicode( ' ' );
|
|
|
|
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
|
2006-01-20 02:19:25 -06:00
|
|
|
if(pViewSh == NULL)
|
2004-07-13 07:48:17 -05:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
|
|
|
|
if(pBase)
|
2007-04-03 09:39:32 -05:00
|
|
|
pViewSh = pBase->GetMainViewShell().get();
|
2004-07-13 07:48:17 -05:00
|
|
|
}
|
2006-05-08 09:30:08 -05:00
|
|
|
if( !pDoc && pViewSh )
|
|
|
|
pDoc = pViewSh->GetDoc();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-03-30 08:47:59 -06:00
|
|
|
bool bMasterView;
|
|
|
|
SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
|
|
|
|
|
2006-05-08 09:30:08 -05:00
|
|
|
if( pPage && pDoc && !bMasterView )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-03-30 08:47:59 -06:00
|
|
|
int nPgNum;
|
2003-06-06 04:45:53 -05:00
|
|
|
|
2006-05-08 09:30:08 -05:00
|
|
|
if( (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
|
|
|
nPgNum = pViewSh->GetPrintedHandoutPageNum();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-03-30 08:47:59 -06:00
|
|
|
nPgNum = (pPage->GetPageNum() - 1) / 2 + 1;
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2006-12-12 09:55:19 -06:00
|
|
|
aRepresentation = pDoc->CreatePageNumValue((USHORT)nPgNum);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2004-03-30 08:47:59 -06:00
|
|
|
else
|
|
|
|
{
|
|
|
|
static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_NUMBER ) );
|
|
|
|
aRepresentation = aNumberText;
|
|
|
|
}
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
pInfo->SetRepresentation( aRepresentation );
|
|
|
|
}
|
2009-05-06 16:51:02 -05:00
|
|
|
else if( dynamic_cast< const SvxPagesField* >(pField) )
|
|
|
|
{
|
|
|
|
String aRepresentation;
|
|
|
|
aRepresentation += sal_Unicode( ' ' );
|
|
|
|
|
|
|
|
::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
|
|
|
|
if(pViewSh == NULL)
|
|
|
|
{
|
|
|
|
::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
|
|
|
|
if(pBase)
|
|
|
|
pViewSh = pBase->GetMainViewShell().get();
|
|
|
|
}
|
|
|
|
if( !pDoc && pViewSh )
|
|
|
|
pDoc = pViewSh->GetDoc();
|
|
|
|
|
|
|
|
bool bMasterView;
|
|
|
|
SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
|
|
|
|
|
|
|
|
USHORT nPageCount = 0;
|
|
|
|
|
|
|
|
if( !bMasterView )
|
|
|
|
{
|
|
|
|
if( pPage && (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
|
|
|
|
{
|
|
|
|
nPageCount = pViewSh->GetPrintedHandoutPageCount();
|
|
|
|
}
|
|
|
|
else if( pDoc )
|
|
|
|
{
|
|
|
|
nPageCount = (USHORT)pDoc->GetSdPageCount(PK_STANDARD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( nPageCount > 0 )
|
|
|
|
{
|
|
|
|
aRepresentation = pDoc->CreatePageNumValue(nPageCount);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_COUNT ) );
|
|
|
|
aRepresentation = aNumberText;
|
|
|
|
}
|
|
|
|
|
|
|
|
pInfo->SetRepresentation( aRepresentation );
|
|
|
|
}
|
2006-12-12 09:55:19 -06:00
|
|
|
else if( (pURLField = dynamic_cast< const SvxURLField* >(pField)) != 0 )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
switch ( pURLField->GetFormat() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
case SVXURLFORMAT_APPDEFAULT: //!!! einstellbar an App???
|
|
|
|
case SVXURLFORMAT_REPR:
|
2006-01-20 02:19:25 -06:00
|
|
|
pInfo->SetRepresentation( pURLField->GetRepresentation() );
|
|
|
|
break;
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
case SVXURLFORMAT_URL:
|
2006-01-20 02:19:25 -06:00
|
|
|
pInfo->SetRepresentation( pURLField->GetURL() );
|
|
|
|
break;
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
2006-01-20 02:19:25 -06:00
|
|
|
String aURL = pURLField->GetURL();
|
2002-05-28 02:58:31 -05:00
|
|
|
|
2003-03-27 03:58:12 -06:00
|
|
|
svtools::ColorConfig aConfig;
|
|
|
|
svtools::ColorConfigEntry eEntry =
|
|
|
|
INetURLHistory::GetOrCreate()->QueryUrl( aURL ) ? svtools::LINKSVISITED : svtools::LINKS;
|
2002-05-28 02:58:31 -05:00
|
|
|
pInfo->SetTxtColor( aConfig.GetColorValue(eEntry).nColor );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2006-01-20 02:19:25 -06:00
|
|
|
else if ( dynamic_cast< const SdrMeasureField* >(pField))
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
pInfo->ClearFldColor();
|
|
|
|
}
|
2006-01-20 02:19:25 -06:00
|
|
|
else
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
|
|
|
String aRepresentation;
|
|
|
|
|
2006-01-20 02:19:25 -06:00
|
|
|
bool bHeaderField = dynamic_cast< const SvxHeaderField* >( pField ) != 0;
|
|
|
|
bool bFooterField = !bHeaderField && (dynamic_cast< const SvxFooterField* >( pField ) != 0 );
|
|
|
|
bool bDateTimeField = !bHeaderField && !bFooterField && (dynamic_cast< const SvxDateTimeField* >( pField ) != 0);
|
2004-03-30 08:47:59 -06:00
|
|
|
|
2006-01-20 02:19:25 -06:00
|
|
|
if( bHeaderField || bFooterField || bDateTimeField )
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
|
|
|
|
bool bMasterView = false;
|
|
|
|
SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
|
2004-03-30 08:47:59 -06:00
|
|
|
|
2006-01-20 02:19:25 -06:00
|
|
|
if( (pPage == NULL) || bMasterView )
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
if( bHeaderField )
|
|
|
|
{
|
|
|
|
static String aHeaderStr( SdResId( STR_FIELD_PLACEHOLDER_HEADER ) );
|
|
|
|
aRepresentation = aHeaderStr;
|
|
|
|
}
|
|
|
|
else if (bFooterField )
|
|
|
|
{
|
|
|
|
static String aFooterStr( SdResId( STR_FIELD_PLACEHOLDER_FOOTER ) );
|
|
|
|
aRepresentation = aFooterStr;
|
|
|
|
}
|
|
|
|
else if (bDateTimeField )
|
|
|
|
{
|
|
|
|
static String aDateTimeStr( SdResId( STR_FIELD_PLACEHOLDER_DATETIME ) );
|
|
|
|
aRepresentation = aDateTimeStr;
|
|
|
|
}
|
2004-03-30 08:47:59 -06:00
|
|
|
}
|
2006-01-20 02:19:25 -06:00
|
|
|
else
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
const sd::HeaderFooterSettings &rSettings = pPage->getHeaderFooterSettings();
|
|
|
|
|
|
|
|
if( bHeaderField )
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
aRepresentation = rSettings.maHeaderText;
|
2004-03-30 08:47:59 -06:00
|
|
|
}
|
2006-01-20 02:19:25 -06:00
|
|
|
else if( bFooterField )
|
2004-03-30 08:47:59 -06:00
|
|
|
{
|
2006-01-20 02:19:25 -06:00
|
|
|
aRepresentation = rSettings.maFooterText;
|
|
|
|
}
|
|
|
|
else if( bDateTimeField )
|
|
|
|
{
|
|
|
|
if( rSettings.mbDateTimeIsFixed )
|
|
|
|
{
|
|
|
|
aRepresentation = rSettings.maDateTimeText;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Date aDate;
|
|
|
|
Time aTime;
|
|
|
|
LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
|
|
|
|
aRepresentation = SvxDateTimeField::GetFormatted( aDate, aTime, (SvxDateFormat)rSettings.meDateTimeFormat, *GetNumberFormatter(), eLang );
|
|
|
|
}
|
2004-03-30 08:47:59 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-01-20 02:19:25 -06:00
|
|
|
else
|
|
|
|
{
|
|
|
|
DBG_ERROR("sd::SdModule::CalcFieldValueHdl(), unknown field type!");
|
|
|
|
}
|
2004-03-30 08:47:59 -06:00
|
|
|
|
2006-01-20 02:19:25 -06:00
|
|
|
if( aRepresentation.Len() == 0 ) // TODO: Edit engine doesn't handle empty fields?
|
|
|
|
aRepresentation += sal_Unicode( ' ' );
|
2004-03-30 08:47:59 -06:00
|
|
|
pInfo->SetRepresentation( aRepresentation );
|
|
|
|
}
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* virt. Methoden fuer Optionendialog
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
SfxItemSet* SdModule::CreateItemSet( USHORT nSlot )
|
|
|
|
{
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::FrameView* pFrameView = NULL;
|
|
|
|
::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
|
2000-09-18 11:07:07 -05:00
|
|
|
SdDrawDocument* pDoc = NULL;
|
|
|
|
|
|
|
|
// Hier wird der DocType vom Optionsdialog gesetzt (nicht Dokument!)
|
|
|
|
DocumentType eDocType = DOCUMENT_TYPE_IMPRESS;
|
|
|
|
if( nSlot == SID_SD_GRAPHIC_OPTIONS )
|
|
|
|
eDocType = DOCUMENT_TYPE_DRAW;
|
|
|
|
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::ViewShell* pViewShell = NULL;
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
if (pDocSh)
|
|
|
|
{
|
|
|
|
pDoc = pDocSh->GetDoc();
|
|
|
|
|
|
|
|
// Wenn der Optionsdialog zum Dokumenttyp identisch ist,
|
|
|
|
// kann auch die FrameView mit uebergeben werden:
|
|
|
|
if( pDoc && eDocType == pDoc->GetDocumentType() )
|
|
|
|
pFrameView = pDocSh->GetFrameView();
|
|
|
|
|
|
|
|
pViewShell = pDocSh->GetViewShell();
|
2004-07-13 07:48:17 -05:00
|
|
|
if (pViewShell != NULL)
|
|
|
|
pViewShell->WriteFrameViewData();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
SdOptions* pOptions = GetSdOptions(eDocType);
|
|
|
|
|
|
|
|
// Pool hat standardmaessig MapUnit Twips (Baeh!)
|
|
|
|
SfxItemPool& rPool = GetPool();
|
|
|
|
rPool.SetDefaultMetric( SFX_MAPUNIT_100TH_MM );
|
|
|
|
|
|
|
|
SfxItemSet* pRet = new SfxItemSet( rPool,
|
|
|
|
SID_ATTR_METRIC, SID_ATTR_METRIC,
|
|
|
|
SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
|
|
|
|
|
|
|
|
ATTR_OPTIONS_LAYOUT, ATTR_OPTIONS_LAYOUT,
|
|
|
|
ATTR_OPTIONS_CONTENTS, ATTR_OPTIONS_CONTENTS,
|
|
|
|
ATTR_OPTIONS_MISC, ATTR_OPTIONS_MISC,
|
|
|
|
|
|
|
|
ATTR_OPTIONS_SNAP, ATTR_OPTIONS_SNAP,
|
|
|
|
|
|
|
|
ATTR_OPTIONS_SCALE_START, ATTR_OPTIONS_SCALE_END,
|
|
|
|
|
|
|
|
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT,
|
|
|
|
|
|
|
|
SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
|
|
|
|
0 );
|
|
|
|
|
|
|
|
// TP_OPTIONS_LAYOUT:
|
|
|
|
pRet->Put( SdOptionsLayoutItem( ATTR_OPTIONS_LAYOUT, pOptions, pFrameView ) );
|
|
|
|
|
|
|
|
UINT16 nDefTab = 0;
|
|
|
|
if( pFrameView)
|
|
|
|
nDefTab = pDoc->GetDefaultTabulator();
|
|
|
|
else
|
|
|
|
nDefTab = pOptions->GetDefTab();
|
|
|
|
pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, nDefTab ) );
|
|
|
|
|
2006-12-12 09:55:19 -06:00
|
|
|
FieldUnit nMetric = (FieldUnit)0xffff;
|
2000-09-18 11:07:07 -05:00
|
|
|
if( pFrameView)
|
|
|
|
nMetric = pDoc->GetUIUnit();
|
|
|
|
else
|
2006-12-12 09:55:19 -06:00
|
|
|
nMetric = (FieldUnit)pOptions->GetMetric();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-12-12 09:55:19 -06:00
|
|
|
if( nMetric == (FieldUnit)0xffff )
|
2010-02-02 16:59:20 -06:00
|
|
|
nMetric = GetFieldUnit();
|
2000-10-12 02:40:47 -05:00
|
|
|
|
2006-12-12 09:55:19 -06:00
|
|
|
pRet->Put( SfxUInt16Item( SID_ATTR_METRIC, (UINT16)nMetric ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
// TP_OPTIONS_CONTENTS:
|
|
|
|
pRet->Put( SdOptionsContentsItem( ATTR_OPTIONS_CONTENTS, pOptions, pFrameView ) );
|
|
|
|
|
|
|
|
// TP_OPTIONS_MISC:
|
2001-05-07 07:14:17 -05:00
|
|
|
SdOptionsMiscItem aSdOptionsMiscItem( ATTR_OPTIONS_MISC, pOptions, pFrameView );
|
|
|
|
if ( pFrameView )
|
2003-04-24 08:37:24 -05:00
|
|
|
{
|
2006-12-12 09:55:19 -06:00
|
|
|
aSdOptionsMiscItem.GetOptionsMisc().SetSummationOfParagraphs( pDoc->IsSummationOfParagraphs() );
|
|
|
|
aSdOptionsMiscItem.GetOptionsMisc().SetPrinterIndependentLayout (
|
2004-01-20 03:37:23 -06:00
|
|
|
(USHORT)pDoc->GetPrinterIndependentLayout());
|
2003-04-24 08:37:24 -05:00
|
|
|
}
|
2001-05-07 07:14:17 -05:00
|
|
|
pRet->Put( aSdOptionsMiscItem );
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
// TP_OPTIONS_SNAP:
|
|
|
|
pRet->Put( SdOptionsSnapItem( ATTR_OPTIONS_SNAP, pOptions, pFrameView ) );
|
|
|
|
|
|
|
|
// TP_SCALE:
|
2001-09-25 06:12:43 -05:00
|
|
|
UINT32 nW = 10L;
|
|
|
|
UINT32 nH = 10L;
|
2000-09-18 11:07:07 -05:00
|
|
|
INT32 nX;
|
|
|
|
INT32 nY;
|
|
|
|
if( pDocSh )
|
|
|
|
{
|
|
|
|
SdrPage* pPage = (SdrPage*) pDoc->GetSdPage(0, PK_STANDARD);
|
|
|
|
Size aSize(pPage->GetSize());
|
|
|
|
nW = aSize.Width();
|
|
|
|
nH = aSize.Height();
|
|
|
|
}
|
2001-09-25 06:12:43 -05:00
|
|
|
|
2002-10-01 08:44:00 -05:00
|
|
|
if(pFrameView)
|
|
|
|
{
|
|
|
|
const Fraction& rFraction = pDoc->GetUIScale();
|
|
|
|
nX=rFraction.GetNumerator();
|
|
|
|
nY=rFraction.GetDenominator();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Optionen aus Configdatei holen
|
|
|
|
pOptions->GetScale( nX, nY );
|
|
|
|
}
|
2001-09-25 06:12:43 -05:00
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
pRet->Put( SfxInt32Item( ATTR_OPTIONS_SCALE_X, nX ) );
|
|
|
|
pRet->Put( SfxInt32Item( ATTR_OPTIONS_SCALE_Y, nY ) );
|
|
|
|
pRet->Put( SfxUInt32Item( ATTR_OPTIONS_SCALE_WIDTH, nW ) );
|
|
|
|
pRet->Put( SfxUInt32Item( ATTR_OPTIONS_SCALE_HEIGHT, nH ) );
|
|
|
|
|
|
|
|
|
|
|
|
// TP_OPTIONS_PRINT:
|
|
|
|
pRet->Put( SdOptionsPrintItem( ATTR_OPTIONS_PRINT, pOptions ) );
|
|
|
|
|
|
|
|
// RID_SVXPAGE_GRID:
|
|
|
|
pRet->Put( SdOptionsGridItem( SID_ATTR_GRID_OPTIONS, pOptions ) );
|
|
|
|
|
|
|
|
return pRet;
|
|
|
|
}
|
|
|
|
void SdModule::ApplyItemSet( USHORT nSlot, const SfxItemSet& rSet )
|
|
|
|
{
|
|
|
|
const SfxPoolItem* pItem = NULL;
|
|
|
|
BOOL bNewDefTab = FALSE;
|
|
|
|
BOOL bNewPrintOptions = FALSE;
|
2001-04-24 05:34:01 -05:00
|
|
|
BOOL bMiscOptions = FALSE;
|
|
|
|
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::FrameView* pFrameView = NULL;
|
|
|
|
::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
|
2000-09-18 11:07:07 -05:00
|
|
|
SdDrawDocument* pDoc = NULL;
|
|
|
|
// Hier wird der DocType vom Optionsdialog gesetzt (nicht Dokument!)
|
|
|
|
DocumentType eDocType = DOCUMENT_TYPE_IMPRESS;
|
|
|
|
if( nSlot == SID_SD_GRAPHIC_OPTIONS )
|
|
|
|
eDocType = DOCUMENT_TYPE_DRAW;
|
|
|
|
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::ViewShell* pViewShell = NULL;
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
if (pDocSh)
|
|
|
|
{
|
|
|
|
pDoc = pDocSh->GetDoc();
|
|
|
|
|
|
|
|
// Wenn der Optionsdialog zum Dokumenttyp identisch ist,
|
|
|
|
// kann auch die FrameView mit uebergeben werden:
|
|
|
|
if( pDoc && eDocType == pDoc->GetDocumentType() )
|
|
|
|
pFrameView = pDocSh->GetFrameView();
|
|
|
|
|
|
|
|
pViewShell = pDocSh->GetViewShell();
|
2004-07-13 07:48:17 -05:00
|
|
|
if (pViewShell != NULL)
|
|
|
|
pViewShell->WriteFrameViewData();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
SdOptions* pOptions = GetSdOptions(eDocType);
|
|
|
|
// Raster
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS ,
|
|
|
|
FALSE, (const SfxPoolItem**) &pItem ))
|
|
|
|
{
|
|
|
|
const SdOptionsGridItem* pGridItem = (SdOptionsGridItem*) pItem;
|
|
|
|
pGridItem->SetOptions( pOptions );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Layout
|
|
|
|
const SdOptionsLayoutItem* pLayoutItem = NULL;
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_LAYOUT,
|
|
|
|
FALSE, (const SfxPoolItem**) &pLayoutItem ))
|
|
|
|
{
|
|
|
|
pLayoutItem->SetOptions( pOptions );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Metric
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC, FALSE, &pItem ) )
|
|
|
|
{
|
|
|
|
if( pDoc && eDocType == pDoc->GetDocumentType() )
|
|
|
|
PutItem( *pItem );
|
|
|
|
pOptions->SetMetric( ( (SfxUInt16Item*) pItem )->GetValue() );
|
|
|
|
}
|
|
|
|
UINT16 nDefTab = pOptions->GetDefTab();
|
|
|
|
// Default-Tabulator
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_DEFTABSTOP, FALSE, &pItem ) )
|
|
|
|
{
|
|
|
|
nDefTab = ( (SfxUInt16Item*) pItem )->GetValue();
|
|
|
|
pOptions->SetDefTab( nDefTab );
|
|
|
|
|
|
|
|
bNewDefTab = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Massstab
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_X, FALSE, &pItem ) )
|
|
|
|
{
|
|
|
|
INT32 nX = ( (SfxInt32Item*) pItem )->GetValue();
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_Y, FALSE, &pItem ) )
|
|
|
|
{
|
|
|
|
INT32 nY = ( (SfxInt32Item*) pItem )->GetValue();
|
|
|
|
pOptions->SetScale( nX, nY );
|
|
|
|
|
2001-09-25 06:12:43 -05:00
|
|
|
// #92067# Apply to document only if doc type match
|
|
|
|
if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
pDoc->SetUIScale( Fraction( nX, nY ) );
|
|
|
|
if( pViewShell )
|
|
|
|
pViewShell->SetRuler( pViewShell->HasRuler() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Contents (Inhalte)
|
|
|
|
const SdOptionsContentsItem* pContentsItem = NULL;
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_CONTENTS,
|
|
|
|
FALSE, (const SfxPoolItem**) &pContentsItem ))
|
|
|
|
{
|
|
|
|
pContentsItem->SetOptions( pOptions );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Misc (Sonstiges)
|
|
|
|
const SdOptionsMiscItem* pMiscItem = NULL;
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_MISC,
|
|
|
|
FALSE, (const SfxPoolItem**) &pMiscItem ))
|
|
|
|
{
|
|
|
|
pMiscItem->SetOptions( pOptions );
|
2001-04-24 05:34:01 -05:00
|
|
|
bMiscOptions = TRUE;
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Fangen/Einrasten
|
|
|
|
const SdOptionsSnapItem* pSnapItem = NULL;
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SNAP,
|
|
|
|
FALSE, (const SfxPoolItem**) &pSnapItem ))
|
|
|
|
{
|
|
|
|
pSnapItem->SetOptions( pOptions );
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxItemSet aPrintSet( GetPool(),
|
|
|
|
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
|
|
|
|
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
|
|
|
|
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT,
|
|
|
|
0 );
|
|
|
|
|
|
|
|
// Drucken
|
|
|
|
const SdOptionsPrintItem* pPrintItem = NULL;
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_PRINT,
|
|
|
|
FALSE, (const SfxPoolItem**) &pPrintItem ))
|
|
|
|
{
|
|
|
|
pPrintItem->SetOptions( pOptions );
|
|
|
|
|
|
|
|
// PrintOptionsSet setzen
|
|
|
|
SdOptionsPrintItem aPrintItem( ATTR_OPTIONS_PRINT, pOptions );
|
|
|
|
SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC );
|
|
|
|
USHORT nFlags = 0;
|
|
|
|
|
2006-12-12 09:55:19 -06:00
|
|
|
nFlags = (aPrintItem.GetOptionsPrint().IsWarningSize() ? SFX_PRINTER_CHG_SIZE : 0) |
|
|
|
|
(aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SFX_PRINTER_CHG_ORIENTATION : 0);
|
2000-09-18 11:07:07 -05:00
|
|
|
aFlagItem.SetValue( nFlags );
|
|
|
|
|
|
|
|
aPrintSet.Put( aPrintItem );
|
2006-12-12 09:55:19 -06:00
|
|
|
aPrintSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
aPrintSet.Put( aFlagItem );
|
|
|
|
|
|
|
|
bNewPrintOptions = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Nur, wenn auch der Dokumenttyp uebereinstimmt...
|
|
|
|
if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() )
|
|
|
|
{
|
|
|
|
if( bNewPrintOptions )
|
|
|
|
{
|
|
|
|
pDocSh->GetPrinter(TRUE)->SetOptions( aPrintSet );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Am Model den DefTab setzen
|
|
|
|
if( bNewDefTab )
|
|
|
|
{
|
|
|
|
SdDrawDocument* pDocument = pDocSh->GetDoc();
|
|
|
|
pDocument->SetDefaultTabulator( nDefTab );
|
|
|
|
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::Outliner* pOutl = pDocument->GetOutliner( FALSE );
|
2000-09-18 11:07:07 -05:00
|
|
|
if( pOutl )
|
|
|
|
pOutl->SetDefTab( nDefTab );
|
|
|
|
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::Outliner* pInternalOutl = pDocument->GetInternalOutliner( FALSE );
|
2000-09-18 11:07:07 -05:00
|
|
|
if( pInternalOutl )
|
|
|
|
pInternalOutl->SetDefTab( nDefTab );
|
|
|
|
}
|
2001-05-07 07:14:17 -05:00
|
|
|
if ( bMiscOptions )
|
2001-04-24 05:34:01 -05:00
|
|
|
{
|
2006-12-12 09:55:19 -06:00
|
|
|
pDoc->SetSummationOfParagraphs( pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() );
|
|
|
|
sal_uInt32 nSum = pMiscItem->GetOptionsMisc().IsSummationOfParagraphs() ? EE_CNTRL_ULSPACESUMMATION : 0;
|
2001-04-24 05:34:01 -05:00
|
|
|
sal_uInt32 nCntrl;
|
|
|
|
|
|
|
|
SdDrawDocument* pDocument = pDocSh->GetDoc();
|
|
|
|
SdrOutliner& rOutl = pDocument->GetDrawOutliner( FALSE );
|
|
|
|
nCntrl = rOutl.GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
|
|
|
|
rOutl.SetControlWord( nCntrl | nSum );
|
2004-01-20 03:37:23 -06:00
|
|
|
::sd::Outliner* pOutl = pDocument->GetOutliner( FALSE );
|
2001-04-24 05:34:01 -05:00
|
|
|
if( pOutl )
|
|
|
|
{
|
|
|
|
nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
|
|
|
|
pOutl->SetControlWord( nCntrl | nSum );
|
|
|
|
}
|
|
|
|
pOutl = pDocument->GetInternalOutliner( FALSE );
|
|
|
|
if( pOutl )
|
|
|
|
{
|
|
|
|
nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
|
|
|
|
pOutl->SetControlWord( nCntrl | nSum );
|
|
|
|
}
|
2003-04-24 08:37:24 -05:00
|
|
|
|
|
|
|
// Set printer independent layout mode.
|
2006-12-12 09:55:19 -06:00
|
|
|
if( pDoc->GetPrinterIndependentLayout() != pMiscItem->GetOptionsMisc().GetPrinterIndependentLayout() )
|
|
|
|
pDoc->SetPrinterIndependentLayout (pMiscItem->GetOptionsMisc().GetPrinterIndependentLayout());
|
2001-04-24 05:34:01 -05:00
|
|
|
}
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
pOptions->StoreConfig();
|
|
|
|
|
|
|
|
// Nur, wenn auch der Dokumenttyp uebereinstimmt...
|
|
|
|
if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() )
|
|
|
|
{
|
|
|
|
FieldUnit eUIUnit = (FieldUnit) pOptions->GetMetric();
|
|
|
|
pDoc->SetUIUnit(eUIUnit);
|
|
|
|
|
|
|
|
if (pViewShell)
|
|
|
|
{
|
|
|
|
// #74495# make sure no one is in text edit mode, cause there
|
|
|
|
// are some pointers remembered else (!)
|
|
|
|
if(pViewShell->GetView())
|
2006-11-14 07:25:10 -06:00
|
|
|
pViewShell->GetView()->SdrEndTextEdit();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-12-12 09:55:19 -06:00
|
|
|
::sd::FrameView* pFrame = pViewShell->GetFrameView();
|
|
|
|
pFrame->Update(pOptions);
|
|
|
|
pViewShell->ReadFrameViewData(pFrame);
|
2000-09-18 11:07:07 -05:00
|
|
|
pViewShell->SetUIUnit(eUIUnit);
|
|
|
|
pViewShell->SetDefTabHRuler( nDefTab );
|
|
|
|
}
|
|
|
|
}
|
2000-09-21 10:12:50 -05:00
|
|
|
|
2003-04-01 08:08:38 -06:00
|
|
|
if( pViewShell && pViewShell->GetViewFrame() )
|
|
|
|
pViewShell->GetViewFrame()->GetBindings().InvalidateAll( TRUE );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2004-02-04 02:53:01 -06:00
|
|
|
|
2002-08-09 07:03:32 -05:00
|
|
|
SfxTabPage* SdModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemSet& rSet )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2002-08-09 07:03:32 -05:00
|
|
|
SfxTabPage* pRet = NULL;
|
2006-12-12 09:55:19 -06:00
|
|
|
SfxAllItemSet aSet(*(rSet.GetPool()));
|
|
|
|
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
|
|
|
|
if( pFact )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 09:55:19 -06:00
|
|
|
switch(nId)
|
2004-02-04 02:53:01 -06:00
|
|
|
{
|
2006-12-12 09:55:19 -06:00
|
|
|
case SID_SD_TP_CONTENTS:
|
|
|
|
case SID_SI_TP_CONTENTS:
|
|
|
|
{ ::CreateTabPage fnCreatePage = pFact->GetSdOptionsContentsTabPageCreatorFunc();
|
|
|
|
if( fnCreatePage )
|
|
|
|
pRet = (*fnCreatePage)( pParent, rSet );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SD_TP_SNAP:
|
|
|
|
case SID_SI_TP_SNAP:
|
|
|
|
{ ::CreateTabPage fnCreatePage = pFact->GetSdOptionsSnapTabPageCreatorFunc();
|
|
|
|
if( fnCreatePage )
|
|
|
|
pRet = (*fnCreatePage)( pParent, rSet );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SD_TP_PRINT:
|
|
|
|
case SID_SI_TP_PRINT:
|
2004-02-04 02:53:01 -06:00
|
|
|
{
|
2006-12-12 09:55:19 -06:00
|
|
|
::CreateTabPage fnCreatePage = pFact->GetSdPrintOptionsTabPageCreatorFunc();
|
|
|
|
if( fnCreatePage )
|
|
|
|
{
|
2004-02-04 02:53:01 -06:00
|
|
|
pRet = (*fnCreatePage)( pParent, rSet );
|
2006-12-12 09:55:19 -06:00
|
|
|
if(SID_SD_TP_PRINT == nId)
|
|
|
|
aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_DRAW_MODE));
|
|
|
|
pRet->PageCreated(aSet);
|
|
|
|
}
|
2004-02-04 02:53:01 -06:00
|
|
|
}
|
2006-12-12 09:55:19 -06:00
|
|
|
break;
|
|
|
|
case SID_SI_TP_MISC:
|
|
|
|
case SID_SD_TP_MISC:
|
|
|
|
{
|
|
|
|
::CreateTabPage fnCreatePage = pFact->GetSdOptionsMiscTabPageCreatorFunc();
|
|
|
|
if( fnCreatePage )
|
|
|
|
{
|
|
|
|
pRet = (*fnCreatePage)( pParent, rSet );
|
|
|
|
if(SID_SD_TP_MISC == nId)
|
|
|
|
aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_DRAW_MODE));
|
|
|
|
else
|
|
|
|
aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_IMPRESS_MODE));
|
|
|
|
pRet->PageCreated(aSet);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RID_OFA_TP_INTERNATIONAL_SD:
|
|
|
|
case RID_OFA_TP_INTERNATIONAL_IMPR:
|
|
|
|
case RID_SVXPAGE_TEXTANIMATION :
|
|
|
|
{
|
|
|
|
SfxAbstractDialogFactory* pSfxFact = SfxAbstractDialogFactory::Create();
|
|
|
|
if ( pSfxFact )
|
|
|
|
{
|
|
|
|
::CreateTabPage fnCreatePage = pSfxFact->GetTabPageCreatorFunc( nId );
|
|
|
|
if ( fnCreatePage )
|
|
|
|
pRet = (*fnCreatePage)( pParent, rSet );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2004-02-04 02:53:01 -06:00
|
|
|
}
|
2006-12-12 09:55:19 -06:00
|
|
|
DBG_ASSERT( pRet, "SdModule::CreateTabPage(): no valid ID for TabPage!" );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
2002-08-09 07:03:32 -05:00
|
|
|
return pRet;
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|