31#include <osl/diagnose.h>
36#include <svx/svxids.hrc>
37#include <svx/dialogs.hrc>
48#include <bitmaps.hlst>
88 if (pSdView !=
nullptr && (pOutliner == &pSdView->
GetOutliner()))
94 sal_Int32 nParaPos = 0;
145 const SvxFieldData* pField = pInfo->GetField().GetField();
172 if( (pDateField =
dynamic_cast< const SvxDateField*
>(pField)) != nullptr )
174 LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
175 pInfo->SetRepresentation( pDateField->
GetFormatted( *GetNumberFormatter(), eLang ) );
177 else if( (pExtTimeField =
dynamic_cast< const SvxExtTimeField *
>(pField)) != nullptr )
179 LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
180 pInfo->SetRepresentation( pExtTimeField->
GetFormatted( *GetNumberFormatter(), eLang ) );
182 else if( (pExtFileField =
dynamic_cast< const SvxExtFileField *
>(pField)) != nullptr )
184 if( pDocShell && (pExtFileField->
GetType() != SvxFileType::Fix) )
194 pInfo->SetRepresentation( pExtFileField->
GetFormatted() );
197 else if( (pAuthorField =
dynamic_cast< const SvxAuthorField*
>( pField )) !=
nullptr )
199 if( pAuthorField->
GetType() != SvxAuthorType::Fix )
208 pInfo->SetRepresentation( pAuthorField->
GetFormatted() );
213 OUString aRepresentation(
" ");
216 if(pViewSh ==
nullptr)
222 if( !pDoc && pViewSh )
228 if( pPage && pDoc && !bMasterView )
243 aRepresentation =
SdResId(STR_FIELD_PLACEHOLDER_NUMBER);
245 pInfo->SetRepresentation( aRepresentation );
249 OUString aRepresentation(
" ");
252 if(pViewSh ==
nullptr)
258 if( !pDoc && pViewSh )
264 if( pPage && pDoc && !bMasterView )
266 aRepresentation = pPage->
GetName();
272 ?
SdResId(STR_FIELD_PLACEHOLDER_SLIDENAME)
273 :
SdResId(STR_FIELD_PLACEHOLDER_PAGENAME) );
276 pInfo->SetRepresentation( aRepresentation );
280 OUString aRepresentation(
" ");
283 if(pViewSh ==
nullptr)
289 if( !pDoc && pViewSh )
295 sal_uInt16 nPageCount = 0;
312 aRepresentation =
SdResId(STR_FIELD_PLACEHOLDER_COUNT);
314 pInfo->SetRepresentation( aRepresentation );
316 else if( (pURLField =
dynamic_cast< const SvxURLField*
>(pField)) !=
nullptr )
320 case SvxURLFormat::AppDefault:
321 case SvxURLFormat::Repr:
325 case SvxURLFormat::Url:
326 pInfo->SetRepresentation( pURLField->
GetURL() );
339 pInfo->SetFieldColor(std::optional<Color>());
350 pInfo->SetRepresentation(sCurrent);
362 OUString aRepresentation;
364 bool bHeaderField =
dynamic_cast< const SvxHeaderField*
>( pField ) !=
nullptr;
365 bool bFooterField = !bHeaderField && (
dynamic_cast< const SvxFooterField*
>( pField ) !=
nullptr );
366 bool bDateTimeField = !bHeaderField && !bFooterField && (
dynamic_cast< const SvxDateTimeField*
>( pField ) !=
nullptr);
368 if( bHeaderField || bFooterField || bDateTimeField )
371 bool bMasterView =
false;
374 if( (pPage ==
nullptr) || bMasterView )
377 aRepresentation =
SdResId(STR_FIELD_PLACEHOLDER_HEADER);
378 else if (bFooterField )
379 aRepresentation =
SdResId(STR_FIELD_PLACEHOLDER_FOOTER);
380 else if (bDateTimeField )
381 aRepresentation =
SdResId(STR_FIELD_PLACEHOLDER_DATETIME);
391 else if( bFooterField )
395 else if( bDateTimeField )
404 LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
413 OSL_FAIL(
"sd::SdModule::CalcFieldValueHdl(), unknown field type!");
416 if( aRepresentation.isEmpty() )
417 aRepresentation =
" ";
418 pInfo->SetRepresentation( aRepresentation );
433 if( nSlot == SID_SD_GRAPHIC_OPTIONS )
446 if (pViewShell !=
nullptr)
457 SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
458 SID_ATTR_METRIC, SID_ATTR_METRIC,
459 SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
460 ATTR_OPTIONS_LAYOUT, ATTR_OPTIONS_SCALE_END> aRet(rPool);
465 sal_uInt16 nDefTab = 0;
481 aRet.Put(
SfxUInt16Item( SID_ATTR_METRIC,
static_cast<sal_uInt16
>(nMetric) ) );
491 aRet.Put( aSdOptionsMiscItem );
537 bool bNewDefTab =
false;
538 bool bNewPrintOptions =
false;
539 bool bMiscOptions =
false;
545 if( nSlot == SID_SD_GRAPHIC_OPTIONS )
555 if (pViewShell !=
nullptr)
562 pGridItem->SetOptions( pOptions );
568 pLayoutItem->SetOptions( pOptions );
576 pOptions->
SetMetric( pItem->GetValue() );
578 sal_uInt16 nDefTab = pOptions->
GetDefTab();
582 nDefTab = pItem->GetValue();
591 sal_Int32 nX = pItem->GetValue();
595 sal_Int32 nY = pItem->GetValue();
624 SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
625 ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT> aPrintSet(
GetPool() );
639 aFlagItem.
SetValue(
static_cast<int>(nFlags) );
641 aPrintSet.Put( aPrintItem );
643 aPrintSet.Put( aFlagItem );
645 bNewPrintOptions =
true;
651 if( bNewPrintOptions )
664 pOutl->SetDefTab( nDefTab );
668 pInternalOutl->SetDefTab( nDefTab );
679 rOutl.SetControlWord( nCntrl | nSum );
684 pOutl->SetControlWord( nCntrl | nSum );
690 pOutl->SetControlWord( nCntrl | nSum );
728 std::unique_ptr<SfxTabPage> xRet;
734 case SID_SD_TP_CONTENTS:
735 case SID_SI_TP_CONTENTS:
739 xRet = (*fnCreatePage)( pPage, pController, &
rSet );
747 xRet = (*fnCreatePage)( pPage, pController, &
rSet );
750 case SID_SD_TP_PRINT:
751 case SID_SI_TP_PRINT:
756 xRet = (*fnCreatePage)( pPage, pController, &
rSet );
757 if(SID_SD_TP_PRINT ==
nId)
759 xRet->PageCreated(aSet);
769 xRet = (*fnCreatePage)( pPage, pController, &
rSet );
770 if(SID_SD_TP_MISC ==
nId)
774 xRet->PageCreated(aSet);
778 case RID_SVXPAGE_TEXTANIMATION :
783 xRet = (*fnCreatePage)( pPage, pController, &
rSet );
787 DBG_ASSERT( xRet,
"SdModule::CreateTabPage(): no valid ID for TabPage!" );
796 aStyleFamilies.emplace_back(SfxStyleFamily::Para,
797 SdResId(STR_GRAPHICS_STYLE_FAMILY),
798 BMP_STYLES_FAMILY_GRAPHICS,
801 aStyleFamilies.emplace_back(SfxStyleFamily::Pseudo,
802 SdResId(STR_PRESENTATIONS_STYLE_FAMILY),
803 BMP_STYLES_FAMILY_PRESENTATIONS,
806 return aStyleFamilies;
Outliner * GetOutliner() const
sal_Int32 GetPara() const
SdrPage * GetSdrPage() const
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
static INetURLHistory * GetOrCreate()
bool QueryUrl(const INetURLObject &rUrl) const
static bool HasParaFlag(const Paragraph *pPara, ParaFlag nFlag)
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
virtual CreateTabPage GetSdPrintOptionsTabPageCreatorFunc()=0
virtual CreateTabPage GetSdOptionsContentsTabPageCreatorFunc()=0
static SD_DLLPUBLIC SdAbstractDialogFactory * Create()
virtual CreateTabPage GetSdOptionsMiscTabPageCreatorFunc()=0
virtual CreateTabPage GetSdOptionsSnapTabPageCreatorFunc()=0
SAL_DLLPRIVATE void SetPrinterIndependentLayout(sal_Int32 nMode)
Set the mode that controls whether (and later how) the formatting of the document depends on the curr...
sal_uInt16 GetActiveSdPageCount() const
SAL_DLLPRIVATE void SetSummationOfParagraphs(bool bOn=true)
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
OUString CreatePageNumValue(sal_uInt16 nNum) const
SAL_DLLPRIVATE bool IsSummationOfParagraphs() const
SdOutliner * GetInternalOutliner(bool bCreateOutliner=true)
SAL_DLLPRIVATE SdOutliner * GetOutliner(bool bCreateOutliner=true)
SAL_DLLPRIVATE sal_Int32 GetPrinterIndependentLayout() const
Get the flag that controls whether the formatting of the document depends on the current printer metr...
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
SAL_DLLPRIVATE DocumentType GetDocumentType() const
virtual std::unique_ptr< SfxTabPage > CreateTabPage(sal_uInt16 nId, weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet) override
virtual void ApplyItemSet(sal_uInt16 nId, const SfxItemSet &rSet) override
SdOptions * GetSdOptions(DocumentType eDocType)
Return options.
virtual std::optional< SfxStyleFamilies > CreateStyleFamilies() override
virtual std::optional< SfxItemSet > CreateItemSet(sal_uInt16 nId) override
virtual methods for option dialog
void SetMetric(sal_uInt16 nInMetric)
sal_uInt16 GetDefTab() const
sal_uInt16 GetMetric() const
void SetDefTab(sal_uInt16 nTab)
SdOptionsMisc & GetOptionsMisc()
void SetOptions(SdOptions *pOpts) const
void SetSummationOfParagraphs(bool bOn)
void SetPrinterIndependentLayout(sal_uInt16 nOn)
Set the printer independent layout mode.
bool IsSummationOfParagraphs() const
sal_uInt16 GetPrinterIndependentLayout() const
Return the currently selected printer independent layout mode.
SdOptionsPrint & GetOptionsPrint()
void SetOptions(SdOptions *pOpts) const
bool IsWarningSize() const
bool IsWarningOrientation() const
bool IsWarningPrinter() const
void SetOptions(SdOptions *pOpts) const
void GetScale(sal_Int32 &rX, sal_Int32 &rY) const
void SetScale(sal_Int32 nInX, sal_Int32 nInY)
The main purpose of this class is searching and replacing as well as spelling of impress documents.
PageKind GetPageKind() const
const sd::HeaderFooterSettings & getHeaderFooterSettings() const
const OUString & GetName() const
void SetUIScale(const Fraction &rScale)
sal_uInt16 GetDefaultTabulator() const
void SetUIUnit(FieldUnit eUnit)
void SetDefaultTabulator(sal_uInt16 nVal)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
FieldUnit GetUIUnit() const
const SdrTextObj * GetFormattingTextObj() const
const Fraction & GetUIScale() const
SdrModel & getSdrModelFromSdrObject() const
SdrPage * getSdrPageFromSdrObject() const
const SdrPage * getVisualizedPage() const
const SdrTextObj * GetTextObj() const
sal_uInt16 GetPageNum() const
bool IsMasterPage() const
static SfxAbstractDialogFactory * Create()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
void InvalidateAll(bool bWithMsg)
void SetValue(sal_uInt16 nNewVal)
void SetDefaultMetric(MapUnit eNewMetric)
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const OUString & GetName() const
FieldUnit GetFieldUnit() const
std::locale GetResLocale() const
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
bool IsLoadingFinished() const
SfxMedium * GetMedium() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
void SetOptions(const SfxItemSet &rNewOptions)
void PutItem(const SfxPoolItem &rItem)
SfxItemPool & GetPool() const
const OUString & GetName() const
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
OUString GetFirstName() const
OUString GetLastName() const
SvxAuthorType GetType() const
OUString GetFormatted() const
SvxAuthorFormat GetFormat() const
OUString GetFormatted(SvNumberFormatter &rFormatter, LanguageType eLanguage) const
static OUString GetFormatted(Date const &rDate, tools::Time const &rTime, SvxDateFormat eDateFormat, SvxTimeFormat eTimeFormat, SvNumberFormatter &rFormatter, LanguageType eLanguage)
OUString GetFormatted() const
SvxFileType GetType() const
OUString GetFormatted(SvNumberFormatter &rFormatter, LanguageType eLanguage) const
const OUString & GetRepresentation() const
SvxURLFormat GetFormat() const
const OUString & GetURL() const
OUString GetFormatted(css::uno::Reference< css::document::XDocumentProperties > const &xDocumentProperties)
OUString const & GetCurrentPresentation() const
::sd::FrameView * GetFrameView()
sd::ViewShell * GetViewShell()
SfxPrinter * GetPrinter(bool bCreate)
Creates (if necessary) and returns a SfxPrinter.
SdDrawDocument * GetDoc()
void Update(SdOptions const *pOptions)
Update with data from the specified SdOptions.
Show a textual overview of the text contents of all slides.
Derivative of sd::View for the outline mode |* .
SdrOutliner & GetOutliner()
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
Base class of the stacked shell hierarchy.
void SetUIUnit(FieldUnit eUnit)
SdDrawDocument * GetDoc() const
virtual void WriteFrameViewData()
sal_uInt16 GetPrintedHandoutPageNum() const
void SetRuler(bool bRuler)
Switch ruler on/off.
FrameView * GetFrameView()
::sd::View * GetView() const
virtual void ReadFrameViewData(FrameView *pView)
sal_uInt16 GetPrintedHandoutPageCount() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
void SetDefTabHRuler(sal_uInt16 nDefTab)
set DefTab at horizontal rulers
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
#define DBG_ASSERT(sCon, aError)
IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo *, pInfo, void)
Link for CalcFieldValue of Outliners.
static SdPage * GetCurrentPage(sd::ViewShell const *pViewSh, EditFieldInfo const *pInfo, bool &bMasterView)
retrieves the page that is currently painted.
OUString SdResId(TranslateId aId)
std::vector< SfxStyleFamilyItem > SfxStyleFamilies