[Libreoffice-commits] core.git: sw/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 3 19:57:49 UTC 2019
sw/source/uibase/app/docst.cxx | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
New commits:
commit 941d53eee9a186e790bb3203b37eeb5fa285d2c4
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 3 13:25:39 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Dec 3 20:56:15 2019 +0100
Use o3tl::doAccess, prevent -Werror=maybe-uninitialized
(and do not unbox Any where it is not necessary anyway)
Change-Id: Ic5461fb8b62157e9116cd2d557ee38fface28fb7
Reviewed-on: https://gerrit.libreoffice.org/84337
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index ac664eb11527..0af55eee0676 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <comphelper/flagguard.hxx>
-
+#include <o3tl/any.hxx>
#include <sal/log.hxx>
#include <hintids.hxx>
#include <sfx2/app.hxx>
@@ -697,21 +697,20 @@ void syncEndnoteOrientation(const uno::Reference< style::XStyleFamiliesSupplier
return;
}
- sal_Int32 nWidth, nHeight;
- bool bIsDefLandScape, bIsEndLandScape;
-
- xDefaultPagePropSet->getPropertyValue("IsLandscape") >>= bIsDefLandScape;
- xEndnotePagePropSet->getPropertyValue("IsLandscape") >>= bIsEndLandScape;
+ auto const bIsDefLandScape = *o3tl::doAccess<bool>(
+ xDefaultPagePropSet->getPropertyValue("IsLandscape"));
+ auto const bIsEndLandScape = *o3tl::doAccess<bool>(
+ xEndnotePagePropSet->getPropertyValue("IsLandscape"));
if (bIsDefLandScape == bIsEndLandScape)
return;
- xEndnotePagePropSet->getPropertyValue("Width") >>= nWidth;
- xEndnotePagePropSet->getPropertyValue("Height") >>= nHeight;
+ auto const nWidth = xEndnotePagePropSet->getPropertyValue("Width");
+ auto const nHeight = xEndnotePagePropSet->getPropertyValue("Height");
xEndnotePagePropSet->setPropertyValue("IsLandscape", css::uno::toAny(bIsDefLandScape));
- xEndnotePagePropSet->setPropertyValue("Width", css::uno::toAny(nHeight));
- xEndnotePagePropSet->setPropertyValue("Height", css::uno::toAny(nWidth));
+ xEndnotePagePropSet->setPropertyValue("Width", nHeight);
+ xEndnotePagePropSet->setPropertyValue("Height", nWidth);
}
}
More information about the Libreoffice-commits
mailing list