summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/source/core/stlsheet.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 5b79e7333176..eb578bdc3d31 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -18,10 +18,12 @@
*/
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/text/XTextColumns.hpp>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
@@ -32,6 +34,7 @@
#include <editeng/fhgtitem.hxx>
#include <editeng/ulspitem.hxx>
#include <svl/hint.hxx>
+#include <svl/intitem.hxx>
#include <svl/itemset.hxx>
#include <svx/xflbmtit.hxx>
@@ -41,6 +44,7 @@
#include <svx/unoshprp.hxx>
#include <svx/unoshape.hxx>
#include <svx/svdpool.hxx>
+#include <svx/sdmetitm.hxx>
#include <svx/sdtaaitm.hxx>
#include <svx/sdtacitm.hxx>
#include <svx/sdtayitm.hxx>
@@ -1003,6 +1007,23 @@ void SAL_CALL SdStyleSheet::setPropertyValue( const OUString& aPropertyName, con
throw IllegalArgumentException();
}
+ if (pEntry->nWID == OWN_ATTR_TEXTCOLUMNS)
+ {
+ if (css::uno::Reference<css::text::XTextColumns> xColumns; aValue >>= xColumns)
+ {
+ rStyleSet.Put(SfxInt16Item(SDRATTR_TEXTCOLUMNS_NUMBER, xColumns->getColumnCount()));
+ if (css::uno::Reference<css::beans::XPropertySet> xPropSet{ xColumns,
+ css::uno::UNO_QUERY })
+ {
+ auto aVal = xPropSet->getPropertyValue("AutomaticDistance");
+ if (sal_Int32 nSpacing; aVal >>= nSpacing)
+ rStyleSet.Put(SdrMetricItem(SDRATTR_TEXTCOLUMNS_SPACING, nSpacing));
+ }
+ return;
+ }
+ throw IllegalArgumentException();
+ }
+
SfxItemSet aSet( GetPool()->GetPool(), {{pEntry->nWID, pEntry->nWID}});
aSet.Put( rStyleSet );