summaryrefslogtreecommitdiffstats
path: root/sd
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:03:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:03:24 +0000
commite3cf16e6fbf8d39cad8762f002b6db1d4f61ed36 (patch)
tree3c1753125149dcf36ba42a57f1574369e8524225 /sd
parentAdding debian version 4:24.2.2-3. (diff)
downloadlibreoffice-e3cf16e6fbf8d39cad8762f002b6db1d4f61ed36.tar.xz
libreoffice-e3cf16e6fbf8d39cad8762f002b6db1d4f61ed36.zip
Merging upstream version 4:24.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/drawdoc2.cxx6
-rw-r--r--sd/source/core/sdpage.cxx3
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx22
3 files changed, 21 insertions, 10 deletions
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index de82a8b953..8f7c9f3328 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -324,7 +324,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPo
if (!aURL.isEmpty() && (aURL[0] == 35))
{
- OUString aHashSlide = "#" + SdResId(STR_PAGE);
+ OUString aHashSlide;
+ if (meDocType == DocumentType::Draw)
+ aHashSlide = "#" + SdResId(STR_PAGE_NAME);
+ else
+ aHashSlide = "#" + SdResId(STR_PAGE);
if (aURL.startsWith(aHashSlide))
{
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 02609a7083..10b4f34b76 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2512,9 +2512,10 @@ const OUString& SdPage::GetName() const
// default name for handout pages
sal_uInt16 nNum = (GetPageNum() + 1) / 2;
- aCreatedPageName = SdResId(STR_PAGE) + " ";
if (static_cast<SdDrawDocument&>(getSdrModelFromSdrPage()).GetDocumentType() == DocumentType::Draw )
aCreatedPageName = SdResId(STR_PAGE_NAME) + " ";
+ else
+ aCreatedPageName = SdResId(STR_PAGE) + " ";
if( getSdrModelFromSdrPage().GetPageNumType() == css::style::NumberingType::NUMBER_NONE )
{
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index 8401ec38cd..92f7e9be1c 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -151,7 +151,8 @@ private:
void FillFormatList(sal_Int32 nSelectedPos);
void GetOrSetDateTimeLanguage( LanguageType &rLanguage, bool bSet );
- void GetOrSetDateTimeLanguage( LanguageType &rLanguage, bool bSet, SdPage* pPage );
+ // returns true if the page has a date/time field item
+ bool GetOrSetDateTimeLanguage(LanguageType& rLanguage, bool bSet, SdPage* pPage);
public:
HeaderFooterTabPage(weld::Container* pParent, SdDrawDocument* pDoc, SdPage* pActualPage, bool bHandoutMode );
@@ -535,25 +536,29 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
}
else
{
- // get the language from the first master page
- // or set it to all master pages
- sal_uInt16 nPageCount = bSet ? mpDoc->GetMasterSdPageCount( PageKind::Notes ) : 1;
+ const sal_uInt16 nPageCount = mpDoc->GetMasterSdPageCount(PageKind::Standard);
sal_uInt16 nPage;
for( nPage = 0; nPage < nPageCount; nPage++ )
{
- GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( nPage, PageKind::Standard ) );
+ SdPage* pMasterSlide = mpDoc->GetMasterSdPage(nPage, PageKind::Standard);
+ bool bHasDateFieldItem = GetOrSetDateTimeLanguage(rLanguage, bSet, pMasterSlide);
+
+ // All pages must use the same language. If getting the language, only need to find one.
+ if (!bSet && bHasDateFieldItem)
+ break;
}
}
}
-void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, bool bSet, SdPage* pPage )
+bool HeaderFooterTabPage::GetOrSetDateTimeLanguage(LanguageType& rLanguage, bool bSet,
+ SdPage* pPage)
{
if( !pPage )
- return;
+ return false;
SdrTextObj* pObj = static_cast<SdrTextObj*>(pPage->GetPresObj( PresObjKind::DateTime ));
if( !pObj )
- return;
+ return false;
Outliner* pOutl = mpDoc->GetInternalOutliner();
pOutl->Init( OutlinerMode::TextObject );
@@ -623,6 +628,7 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
pOutl->Clear();
pOutl->Init( nOutlMode );
+ return bHasDateFieldItem;
}
PresLayoutPreview::PresLayoutPreview()