summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drawinglayer/inc/drawinglayer/XShapeDumper.hxx4
-rw-r--r--drawinglayer/source/dumper/XShapeDumper.cxx54
2 files changed, 58 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx
index ed00e9667c4e..8f968d1e8de1 100644
--- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx
+++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx
@@ -45,6 +45,8 @@
#include <com/sun/star/drawing/PolygonKind.hpp>
#include <com/sun/star/drawing/TextFitToSizeType.hpp>
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#ifndef ChartViewDumper_hxx
#define ChartViewDumper_hxx
@@ -116,6 +118,8 @@ private:
void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter);
void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter);
void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter);
+ void dumpTextHorizontalAdjustAsAttribute(com::sun::star::drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter);
+ void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter);
// XShape.idl
void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter);
diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx
index 14c243f06ab2..fc1a57d05298 100644
--- a/drawinglayer/source/dumper/XShapeDumper.cxx
+++ b/drawinglayer/source/dumper/XShapeDumper.cxx
@@ -651,6 +651,48 @@ namespace {
}
}
+ void XShapeDumper::dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter)
+ {
+ switch(eTextHorizontalAdjust)
+ {
+ case drawing::TextHorizontalAdjust_LEFT:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT");
+ break;
+ case drawing::TextHorizontalAdjust_CENTER:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER");
+ break;
+ case drawing::TextHorizontalAdjust_RIGHT:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT");
+ break;
+ case drawing::TextHorizontalAdjust_BLOCK:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK");
+ break;
+ default:
+ break;
+ }
+ }
+
+ void XShapeDumper::dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter)
+ {
+ switch(eTextVerticalAdjust)
+ {
+ case drawing::TextVerticalAdjust_TOP:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "TOP");
+ break;
+ case drawing::TextVerticalAdjust_CENTER:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "CENTER");
+ break;
+ case drawing::TextVerticalAdjust_BOTTOM:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM");
+ break;
+ case drawing::TextVerticalAdjust_BLOCK:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK");
+ break;
+ default:
+ break;
+ }
+ }
+
// --------------------------------
// ---------- XShape.idl ----------
// --------------------------------
@@ -735,6 +777,18 @@ namespace {
if(anotherAny >>= eTextFitToSize)
dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter);
}
+ {
+ uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust");
+ drawing::TextHorizontalAdjust eTextHorizontalAdjust;
+ if(anotherAny >>= eTextHorizontalAdjust)
+ dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter);
+ }
+ {
+ uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust");
+ drawing::TextVerticalAdjust eTextVerticalAdjust;
+ if(anotherAny >>= eTextVerticalAdjust)
+ dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter);
+ }
}
else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
{