summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unoprnms.hxx1
-rw-r--r--sw/source/core/unocore/unoframe.cxx21
-rw-r--r--sw/source/core/unocore/unomap1.cxx1
3 files changed, 23 insertions, 0 deletions
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 21e68ea83296..e5e1f31d2464 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -829,6 +829,7 @@
#define UNO_NAME_INITIALS "Initials"
#define UNO_NAME_TABLE_BORDER2 "TableBorder2"
#define UNO_NAME_REPLACEMENT_GRAPHIC_URL "ReplacementGraphicURL"
+#define UNO_NAME_REPLACEMENT_GRAPHIC "ReplacementGraphic"
#define UNO_NAME_HIDDEN "Hidden"
#define UNO_NAME_DEFAULT_PAGE_MODE "DefaultPageMode"
#define UNO_NAME_CHAR_SHADING_VALUE "CharShadingValue"
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index c576e2ffc459..8b3595b40af0 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2107,6 +2107,27 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
aAny <<= sGrfName;
}
+ else if (FN_UNO_REPLACEMENT_GRAPHIC == pEntry->nWID)
+ {
+ const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
+ uno::Reference<graphic::XGraphic> xGraphic;
+
+ if (pIdx)
+ {
+ SwNodeIndex aIdx(*pIdx, 1);
+ SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
+ if (!pGrfNode)
+ throw uno::RuntimeException();
+
+ const GraphicObject* pGraphicObject = pGrfNode->GetReplacementGrfObj();
+
+ if (pGraphicObject)
+ {
+ xGraphic = pGraphicObject->GetGraphic().GetXGraphic();
+ }
+ }
+ aAny <<= xGraphic;
+ }
else if( FN_UNO_GRAPHIC_FILTER == pEntry->nWID )
{
OUString sFltName;
diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx
index 8f0352f09394..7074c5b2b0f6 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -848,6 +848,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetGraphicPropertyMap(
{ OUString(UNO_NAME_VERT_MIRRORED), RES_GRFATR_MIRRORGRF, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_MIRROR_VERT },
{ OUString(UNO_NAME_GRAPHIC_URL), FN_UNO_GRAPHIC_U_R_L, cppu::UnoType<OUString>::get(), 0, 0 },
{ OUString(UNO_NAME_REPLACEMENT_GRAPHIC_URL), FN_UNO_REPLACEMENT_GRAPHIC_U_R_L, cppu::UnoType<OUString>::get(), 0, 0 },
+ { OUString(UNO_NAME_REPLACEMENT_GRAPHIC), FN_UNO_REPLACEMENT_GRAPHIC, cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 },
{ OUString(UNO_NAME_GRAPHIC_FILTER), FN_UNO_GRAPHIC_FILTER, cppu::UnoType<OUString>::get(), 0, 0 },
{ OUString(UNO_NAME_GRAPHIC), FN_UNO_GRAPHIC, cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 },
{ OUString(UNO_NAME_ACTUAL_SIZE), FN_UNO_ACTUAL_SIZE, cppu::UnoType<css::awt::Size>::get(), PropertyAttribute::READONLY, CONVERT_TWIPS},