diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-04-25 23:45:22 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-04-28 03:31:59 +0200 |
commit | a6a38c6de9c18fd1269fc8cfc0e070ef429c8e2f (patch) | |
tree | f1ad4d49dff3cb9eb0121389999030841409a7e0 /sw/source | |
parent | e71d05eaa9a8c9e628b256f3e889b85ac11ed474 (diff) |
[API CHANGE] deprecate and revert GraphicURL prop. NumberingLevel
This deprecates the GraphicURL properties for NumberingLevel used
for bullet graphic. It also makes the proeprty work again, but
only setting it is supported.
Change-Id: I7727918677514b4846fd271ba606a0255bf9fe1b
Reviewed-on: https://gerrit.libreoffice.org/53458
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/unocore/unosett.cxx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 3825caeb1951..a283a7954e7d 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -59,6 +59,7 @@ #include <editeng/flstitem.hxx> #include <vcl/metric.hxx> #include <vcl/graph.hxx> +#include <vcl/GraphicLoader.hxx> #include <svtools/ctrltool.hxx> #include <vcl/svapp.hxx> #include <editeng/unofdesc.hxx> @@ -1564,7 +1565,8 @@ void SwXNumberingRules::SetPropertiesToNumFormat( UNO_NAME_HEADING_STYLE_NAME, // 24 // these two are accepted but ignored for some reason UNO_NAME_BULLET_REL_SIZE, // 25 - UNO_NAME_BULLET_COLOR // 26 + UNO_NAME_BULLET_COLOR, // 26 + UNO_NAME_GRAPHIC_URL // 27 }; enum { @@ -1999,6 +2001,31 @@ void SwXNumberingRules::SetPropertiesToNumFormat( break; case 26: // BulletColor - ignored too break; + case 27: // UNO_NAME_GRAPHIC_URL + { + assert( !pDocShell ); + OUString aURL; + if (pProp->Value >>= aURL) + { + if(!pSetBrush) + { + const SvxBrushItem* pOrigBrush = aFormat.GetBrush(); + if(pOrigBrush) + { + pSetBrush = new SvxBrushItem(*pOrigBrush); + } + else + pSetBrush = new SvxBrushItem(OUString(), OUString(), GPOS_AREA, RES_BACKGROUND); + } + + Graphic aGraphic = vcl::graphic::loadFromURL(aURL); + if (aGraphic) + pSetBrush->SetGraphic(aGraphic); + } + else + bWrongArg = true; + } + break; } } if(!bExcept && !bWrongArg && (pSetBrush || pSetSize || pSetVOrient)) |