summaryrefslogtreecommitdiff
path: root/sw/source/core/attr
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/attr')
-rw-r--r--sw/source/core/attr/format.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index b668c8e24e6e..61149cae8d62 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -33,6 +33,7 @@
#include <svx/unobrushitemhelper.hxx>
#include <svx/xdef.hxx>
#include <swcache.hxx>
+#include <GetMetricVal.hxx>
using namespace com::sun::star;
@@ -690,6 +691,20 @@ void SwFormat::DelDiffs( const SfxItemSet& rSet )
sw::ClientNotifyAttrChg(*this, m_aSet, aOld, aNew);
}
+void SwFormat::SetPageFormatToDefault()
+{
+
+ SvxLRSpaceItem aLR(RES_LR_SPACE);
+ sal_Int32 nSize = GetMetricVal(CM_1) * 2;
+ aLR.SetLeft(nSize);
+ aLR.SetRight(nSize);
+ SvxULSpaceItem aUL(RES_UL_SPACE);
+ aUL.SetUpper(static_cast<sal_uInt16>(nSize));
+ aUL.SetLower(static_cast<sal_uInt16>(nSize));
+ SetFormatAttr(aLR);
+ SetFormatAttr(aUL);
+}
+
/** SwFormat::IsBackgroundTransparent
Virtual method to determine, if background of format is transparent.