diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-10-16 10:16:17 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-10-16 18:12:49 +0200 |
commit | ac10792ed4ca8d92f60c95ab4acd5b911e42cec7 (patch) | |
tree | 2dd1eff983d413191488f38d4b74cbc65d221d92 | |
parent | 8546cdb2ad25b03ac152615357cab0006340d92f (diff) |
Simplify vector initialization in reportdesign
Change-Id: Ic1927155b23f056fc1117b7726ab4b2eff8a6da3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123690
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index d9a673e81250..df89720fe7c5 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -18,6 +18,7 @@ */ #include <memory> +#include <o3tl/safeint.hxx> #include "xmlExport.hxx" #include "xmlAutoStyle.hxx" #include <xmloff/xmltoken.hxx> @@ -497,15 +498,19 @@ void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp) const sal_Int32 nOffset = rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_LEFTMARGIN); const sal_Int32 nCount = _xProp->getCount(); - ::std::vector<sal_Int32> aColumnPos; + ::std::vector<sal_Int32> aColumnPos + { + nOffset, + aSize.Width - rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_RIGHTMARGIN) + }; aColumnPos.reserve(2*(nCount + 1)); - aColumnPos.push_back(nOffset); - aColumnPos.push_back(aSize.Width - rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_RIGHTMARGIN)); - ::std::vector<sal_Int32> aRowPos; + ::std::vector<sal_Int32> aRowPos + { + 0, + o3tl::narrowing<sal_Int32>(_xProp->getHeight()) + }; aRowPos.reserve(2*(nCount + 1)); - aRowPos.push_back(0); - aRowPos.push_back(_xProp->getHeight()); ::std::vector<sal_Int32> aRowPosAutoGrow; |