summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/SwXDocumentSettings.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-02-04 16:55:13 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-02-04 18:08:51 +0100
commit97abf85bb152b8a665dff6fd8b65fffea5365dc8 (patch)
treef1e490239090928af9e63c06b48d647c224ddefe /sw/source/uibase/uno/SwXDocumentSettings.cxx
parent10943505162d515f16acfb4d195d171421ff834f (diff)
tdf#91920 sw page gutter margin, from top: add doc model & UNO API
Do this per-doc, rather than per-page-desc, because Word doesn't support it per-section, so we would just create interop problems for ourselves with supporting it per-page-desc. Change-Id: Id3c6aac7323deb8d27bab08675ff623f90a63cd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110423 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/uibase/uno/SwXDocumentSettings.cxx')
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index faa0ef5e7d2b..19dabb9ea6b8 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -146,6 +146,7 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_PROTECT_FIELDS,
HANDLE_HEADER_SPACING_BELOW_LAST_PARA,
HANDLE_FRAME_AUTOWIDTH_WITH_MORE_PARA,
+ HANDLE_GUTTER_AT_TOP,
};
}
@@ -239,6 +240,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
{ OUString("ProtectFields"), HANDLE_PROTECT_FIELDS, cppu::UnoType<bool>::get(), 0 },
{ OUString("HeaderSpacingBelowLastPara"), HANDLE_HEADER_SPACING_BELOW_LAST_PARA, cppu::UnoType<bool>::get(), 0 },
{ OUString("FrameAutowidthWithMorePara"), HANDLE_FRAME_AUTOWIDTH_WITH_MORE_PARA, cppu::UnoType<bool>::get(), 0 },
+ { OUString("GutterAtTop"), HANDLE_GUTTER_AT_TOP, cppu::UnoType<bool>::get(), 0 },
/*
* As OS said, we don't have a view when we need to set this, so I have to
@@ -1000,6 +1002,15 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
}
}
break;
+ case HANDLE_GUTTER_AT_TOP:
+ {
+ bool bTmp;
+ if (rValue >>= bTmp)
+ {
+ mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::GUTTER_AT_TOP, bTmp);
+ }
+ }
+ break;
default:
throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
}
@@ -1496,6 +1507,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA);
}
break;
+ case HANDLE_GUTTER_AT_TOP:
+ {
+ rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP);
+ }
+ break;
default:
throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
}