diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-06-07 09:28:12 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-05-10 16:19:27 +0200 |
commit | 8fbf8121a0cc640cf95448353e11d4bc07b2948d (patch) | |
tree | 3e97800b79436bc6f43c16b83363aa26f46ea69a /sw/source/core | |
parent | 7ef62902c1840e265ee1a68c3d291b179a6ea251 (diff) |
More uses of referer URL with SvxBrushItem
Reviewed-on: https://gerrit.libreoffice.org/73643
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit b518882de8213ef71a8003f95fbdf7689069c06d)
Conflicts:
sw/source/core/text/porfld.cxx
sw/source/core/unocore/unosett.cxx
Reviewed-on: https://gerrit.libreoffice.org/73860
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 87c418a98650ab6e4a62a0b4b72e02fee358dced)
Change-Id: I04b524784df4ef453d8b1feec13b62f183a17e23
Diffstat (limited to 'sw/source/core')
-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 |
4 files changed, 26 insertions, 6 deletions
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 0e7b5e97c1eb..f614be78559b 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -754,7 +754,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 ) : @@ -768,7 +768,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 88146081d247..157ba19898a8 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 faa5fa153ae3..5fbbc2447983 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 *pFrame ) @@ -478,8 +479,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 80268724eb62..6ccff0bffc00 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 <osl/mutex.hxx> #include <vcl/svapp.hxx> @@ -1322,13 +1323,21 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex( SwStyleNameMapper::FillProgName(sValue, aUString, SwGetPoolIdFromName::TxtColl, true); } - 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; @@ -1460,7 +1469,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() ); |