diff options
-rw-r--r-- | sw/inc/unosett.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/porfld.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/porfld.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/text/txtfld.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/unocore/unosett.cxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/config/StoredChapterNumbering.cxx | 2 |
6 files changed, 28 insertions, 8 deletions
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx index 295eb06fe671..185b5bcb40fe 100644 --- a/sw/inc/unosett.hxx +++ b/sw/inc/unosett.hxx @@ -210,7 +210,7 @@ public: static css::uno::Sequence<css::beans::PropertyValue> GetPropertiesForNumFormat( const SwNumFormat& rFormat, OUString const& rCharFormatName, - OUString const* pHeadingStyleName); + OUString const* pHeadingStyleName, OUString const & referer); static void SetPropertiesToNumFormat( SwNumFormat & aFormat, OUString & rCharStyleName, diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index de30d4e9cfc3..61dfdef65884 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -756,7 +756,7 @@ SwBulletPortion::SwBulletPortion( const sal_Unicode cBullet, SwGrfNumPortion::SwGrfNumPortion( const OUString& rGraphicFollowedBy, - const SvxBrushItem* pGrfBrush, + const SvxBrushItem* pGrfBrush, OUString const & referer, const SwFormatVertOrient* pGrfOrient, const Size& rGrfSize, const bool bLft, const bool bCntr, const sal_uInt16 nMinDst, const bool bLabelAlignmentPosAndSpaceModeActive ) : @@ -770,7 +770,7 @@ SwGrfNumPortion::SwGrfNumPortion( if( pGrfBrush ) { *pBrush = *pGrfBrush; - const Graphic* pGraph = pGrfBrush->GetGraphic(); + const Graphic* pGraph = pGrfBrush->GetGraphic(referer); if( pGraph ) SetAnimated( pGraph->IsAnimated() ); else diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx index a18f1343451b..db5a3518f482 100644 --- a/sw/source/core/text/porfld.hxx +++ b/sw/source/core/text/porfld.hxx @@ -168,6 +168,7 @@ class SwGrfNumPortion : public SwNumberPortion public: SwGrfNumPortion( const OUString& rGraphicFollowedBy, const SvxBrushItem* pGrfBrush, + OUString const & referer, const SwFormatVertOrient* pGrfOrient, const Size& rGrfSize, const bool bLeft, diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index da9aadf13d03..fd001b01e103 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -52,6 +52,7 @@ #include <flddat.hxx> #include <fmtautofmt.hxx> #include <IDocumentSettingAccess.hxx> +#include <sfx2/docfile.hxx> #include <svl/itemiter.hxx> static bool lcl_IsInBody( SwFrame const *pFrame ) @@ -483,8 +484,17 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con if( SVX_NUM_BITMAP == rNumFormat.GetNumberingType() ) { + OUString referer; + if (auto const sh1 = rInf.GetVsh()) { + if (auto const doc = sh1->GetDoc()) { + auto const sh2 = doc->GetPersist(); + if (sh2 != nullptr && sh2->HasName()) { + referer = sh2->GetMedium()->GetName(); + } + } + } pRet = new SwGrfNumPortion( pTextNd->GetLabelFollowedBy(), - rNumFormat.GetBrush(), + rNumFormat.GetBrush(), referer, rNumFormat.GetGraphicOrientation(), rNumFormat.GetGraphicSize(), bLeft, bCenter, nMinDist, diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index f7376b93693f..da076ebf39e2 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -57,6 +57,7 @@ #include <vcl/font.hxx> #include <editeng/flstitem.hxx> #include <vcl/metric.hxx> +#include <sfx2/docfile.hxx> #include <svtools/ctrltool.hxx> #include <vcl/svapp.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -1316,13 +1317,21 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex( SwStyleNameMapper::FillProgName(sValue, aUString, SwGetPoolIdFromName::TxtColl); } - return GetPropertiesForNumFormat(rFormat, CharStyleName, (pDocShell) ? & aUString : nullptr); + OUString referer; + if (pDoc != nullptr) { + auto const sh = pDoc->GetPersist(); + if (sh != nullptr && sh->HasName()) { + referer = sh->GetMedium()->GetName(); + } + } + return GetPropertiesForNumFormat( + rFormat, CharStyleName, (pDocShell) ? & aUString : nullptr, referer); } uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat( const SwNumFormat& rFormat, OUString const& rCharFormatName, - OUString const*const pHeadingStyleName) + OUString const*const pHeadingStyleName, OUString const & referer) { bool bChapterNum = pHeadingStyleName != nullptr; @@ -1454,7 +1463,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat //graphicbitmap const Graphic* pGraphic = nullptr; if(pBrush ) - pGraphic = pBrush->GetGraphic(); + pGraphic = pBrush->GetGraphic(referer); if(pGraphic) { uno::Reference<awt::XBitmap> xBmp = VCLUnoHelper::CreateBitmap( pGraphic->GetBitmapEx() ); diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx index c575863f00e7..b972ec5edd7c 100644 --- a/sw/source/uibase/config/StoredChapterNumbering.cxx +++ b/sw/source/uibase/config/StoredChapterNumbering.cxx @@ -129,7 +129,7 @@ public: OUString dummy; // pass in empty HeadingStyleName - can't import anyway uno::Sequence<beans::PropertyValue> const ret( SwXNumberingRules::GetPropertiesForNumFormat( - *pNumFormat, *pCharStyleName, &dummy)); + *pNumFormat, *pCharStyleName, &dummy, "")); return uno::makeAny(ret); } |