[Libreoffice-commits] core.git: sc/source sfx2/source starmath/source sw/source toolkit/source vcl/source vcl/win xmloff/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Oct 29 04:59:38 UTC 2018
sc/source/filter/xml/XMLStylesExportHelper.cxx | 20 -
sc/source/filter/xml/xmlwrap.cxx | 11 -
sc/source/ui/view/viewdata.cxx | 266 ++++++++++++-------------
sfx2/source/view/viewfrm.cxx | 53 ++--
sfx2/source/view/viewfrm2.cxx | 8
starmath/source/symbol.cxx | 4
sw/source/core/fields/usrfld.cxx | 3
sw/source/filter/xml/xmlexp.cxx | 36 +--
sw/source/uibase/shells/textsh.cxx | 3
sw/source/uibase/sidebar/ThemePanel.cxx | 10
sw/source/uibase/wrtsh/wrtsh2.cxx | 10
toolkit/source/controls/unocontrol.cxx | 3
vcl/source/window/toolbox.cxx | 96 ++++-----
vcl/source/window/window.cxx | 8
vcl/source/window/winproc.cxx | 20 -
vcl/win/gdi/winlayout.cxx | 19 -
xmloff/source/core/xmlimp.cxx | 25 --
17 files changed, 263 insertions(+), 332 deletions(-)
New commits:
commit 951a65923c088a1e19a4073f3c26a3b564a0a922
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sun Oct 28 23:51:21 2018 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Oct 29 05:59:15 2018 +0100
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I0516dc68cf7d451eafc044be8e50a66d2bddf15f
Reviewed-on: https://gerrit.libreoffice.org/62484
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 67dea682459e..5a7902e215cc 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -550,19 +550,15 @@ void ScRowFormatRanges::AddRange(const sal_Int32 nPrevStartCol, const sal_Int32
bool bInserted(false);
if (!aRowFormatRanges.empty())
{
- ScMyRowFormatRange* pRange(&aRowFormatRanges.back());
- if (pRange)
+ ScMyRowFormatRange& rRange(aRowFormatRanges.back());
+ if ((nPrevStartCol == (rRange.nStartColumn + rRange.nRepeatColumns))
+ && (rRange.bIsAutoStyle == rFormatRange.bIsAutoStyle) && (rRange.nIndex == nIndex)
+ && (rRange.nValidationIndex == rFormatRange.nValidationIndex))
{
- if ((nPrevStartCol == (pRange->nStartColumn + pRange->nRepeatColumns)) &&
- (pRange->bIsAutoStyle == rFormatRange.bIsAutoStyle) &&
- (pRange->nIndex == nIndex) &&
- (pRange->nValidationIndex == rFormatRange.nValidationIndex))
- {
- if (rFormatRange.nRepeatRows < pRange->nRepeatRows)
- pRange->nRepeatRows = rFormatRange.nRepeatRows;
- pRange->nRepeatColumns += nRepeat;
- bInserted = true;
- }
+ if (rFormatRange.nRepeatRows < rRange.nRepeatRows)
+ rRange.nRepeatRows = rFormatRange.nRepeatRows;
+ rRange.nRepeatColumns += nRepeat;
+ bInserted = true;
}
}
if (!bInserted)
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 89cf3142d368..a81f7fb6475e 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -866,9 +866,6 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
SAL_INFO( "sc.filter", "meta export end" );
}
- uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
- rtl::Reference<SvXMLEmbeddedObjectHelper> xObjectHelper;
-
uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
rtl::Reference<SvXMLGraphicHelper> xGraphicHelper;
@@ -878,11 +875,9 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
xGraphicStorageHandler = xGraphicHelper.get();
}
- if( pObjSh )
- {
- xObjectHelper = SvXMLEmbeddedObjectHelper::Create( xStorage, *pObjSh, SvXMLEmbeddedObjectHelperMode::Write );
- xObjectResolver = xObjectHelper.get();
- }
+ auto xObjectHelper = SvXMLEmbeddedObjectHelper::Create(
+ xStorage, *pObjSh, SvXMLEmbeddedObjectHelperMode::Write);
+ uno::Reference<document::XEmbeddedObjectResolver> xObjectResolver(xObjectHelper.get());
// styles export
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index acb270806588..c18d9289e1d5 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -500,56 +500,54 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
{
rSettings.realloc(SC_TABLE_VIEWSETTINGS_COUNT);
beans::PropertyValue* pSettings = rSettings.getArray();
- if (pSettings)
- {
- pSettings[SC_CURSOR_X].Name = SC_CURSORPOSITIONX;
- pSettings[SC_CURSOR_X].Value <<= sal_Int32(nCurX);
- pSettings[SC_CURSOR_Y].Name = SC_CURSORPOSITIONY;
- pSettings[SC_CURSOR_Y].Value <<= sal_Int32(nCurY);
- pSettings[SC_HORIZONTAL_SPLIT_MODE].Name = SC_HORIZONTALSPLITMODE;
- pSettings[SC_HORIZONTAL_SPLIT_MODE].Value <<= sal_Int16(eHSplitMode);
- pSettings[SC_VERTICAL_SPLIT_MODE].Name = SC_VERTICALSPLITMODE;
- pSettings[SC_VERTICAL_SPLIT_MODE].Value <<= sal_Int16(eVSplitMode);
- pSettings[SC_HORIZONTAL_SPLIT_POSITION].Name = SC_HORIZONTALSPLITPOSITION;
- if (eHSplitMode == SC_SPLIT_FIX)
- pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nFixPosX);
- else
- pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nHSplitPos);
- pSettings[SC_VERTICAL_SPLIT_POSITION].Name = SC_VERTICALSPLITPOSITION;
- if (eVSplitMode == SC_SPLIT_FIX)
- pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nFixPosY);
- else
- pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nVSplitPos);
- // Prevent writing odd settings that would make crash versions that
- // don't apply SanitizeWhichActive() when reading the settings.
- // See tdf#117093
- const ScSplitPos eActiveSplitRange = SanitizeWhichActive();
- // And point out to give us a chance to inspect weird things (if anyone
- // remembers what s/he did).
- assert(eWhichActive == eActiveSplitRange);
- pSettings[SC_ACTIVE_SPLIT_RANGE].Name = SC_ACTIVESPLITRANGE;
- pSettings[SC_ACTIVE_SPLIT_RANGE].Value <<= sal_Int16(eActiveSplitRange);
- pSettings[SC_POSITION_LEFT].Name = SC_POSITIONLEFT;
- pSettings[SC_POSITION_LEFT].Value <<= sal_Int32(nPosX[SC_SPLIT_LEFT]);
- pSettings[SC_POSITION_RIGHT].Name = SC_POSITIONRIGHT;
- pSettings[SC_POSITION_RIGHT].Value <<= sal_Int32(nPosX[SC_SPLIT_RIGHT]);
- pSettings[SC_POSITION_TOP].Name = SC_POSITIONTOP;
- pSettings[SC_POSITION_TOP].Value <<= sal_Int32(nPosY[SC_SPLIT_TOP]);
- pSettings[SC_POSITION_BOTTOM].Name = SC_POSITIONBOTTOM;
- pSettings[SC_POSITION_BOTTOM].Value <<= sal_Int32(nPosY[SC_SPLIT_BOTTOM]);
-
- sal_Int32 nZoomValue = long(aZoomY * 100);
- sal_Int32 nPageZoomValue = long(aPageZoomY * 100);
- pSettings[SC_TABLE_ZOOM_TYPE].Name = SC_ZOOMTYPE;
- pSettings[SC_TABLE_ZOOM_TYPE].Value <<= sal_Int16(eZoomType);
- pSettings[SC_TABLE_ZOOM_VALUE].Name = SC_ZOOMVALUE;
- pSettings[SC_TABLE_ZOOM_VALUE].Value <<= nZoomValue;
- pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Name = SC_PAGEVIEWZOOMVALUE;
- pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue;
-
- pSettings[SC_TABLE_SHOWGRID].Name = SC_UNO_SHOWGRID;
- pSettings[SC_TABLE_SHOWGRID].Value <<= bShowGrid;
- }
+
+ pSettings[SC_CURSOR_X].Name = SC_CURSORPOSITIONX;
+ pSettings[SC_CURSOR_X].Value <<= sal_Int32(nCurX);
+ pSettings[SC_CURSOR_Y].Name = SC_CURSORPOSITIONY;
+ pSettings[SC_CURSOR_Y].Value <<= sal_Int32(nCurY);
+ pSettings[SC_HORIZONTAL_SPLIT_MODE].Name = SC_HORIZONTALSPLITMODE;
+ pSettings[SC_HORIZONTAL_SPLIT_MODE].Value <<= sal_Int16(eHSplitMode);
+ pSettings[SC_VERTICAL_SPLIT_MODE].Name = SC_VERTICALSPLITMODE;
+ pSettings[SC_VERTICAL_SPLIT_MODE].Value <<= sal_Int16(eVSplitMode);
+ pSettings[SC_HORIZONTAL_SPLIT_POSITION].Name = SC_HORIZONTALSPLITPOSITION;
+ if (eHSplitMode == SC_SPLIT_FIX)
+ pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nFixPosX);
+ else
+ pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nHSplitPos);
+ pSettings[SC_VERTICAL_SPLIT_POSITION].Name = SC_VERTICALSPLITPOSITION;
+ if (eVSplitMode == SC_SPLIT_FIX)
+ pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nFixPosY);
+ else
+ pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nVSplitPos);
+ // Prevent writing odd settings that would make crash versions that
+ // don't apply SanitizeWhichActive() when reading the settings.
+ // See tdf#117093
+ const ScSplitPos eActiveSplitRange = SanitizeWhichActive();
+ // And point out to give us a chance to inspect weird things (if anyone
+ // remembers what s/he did).
+ assert(eWhichActive == eActiveSplitRange);
+ pSettings[SC_ACTIVE_SPLIT_RANGE].Name = SC_ACTIVESPLITRANGE;
+ pSettings[SC_ACTIVE_SPLIT_RANGE].Value <<= sal_Int16(eActiveSplitRange);
+ pSettings[SC_POSITION_LEFT].Name = SC_POSITIONLEFT;
+ pSettings[SC_POSITION_LEFT].Value <<= sal_Int32(nPosX[SC_SPLIT_LEFT]);
+ pSettings[SC_POSITION_RIGHT].Name = SC_POSITIONRIGHT;
+ pSettings[SC_POSITION_RIGHT].Value <<= sal_Int32(nPosX[SC_SPLIT_RIGHT]);
+ pSettings[SC_POSITION_TOP].Name = SC_POSITIONTOP;
+ pSettings[SC_POSITION_TOP].Value <<= sal_Int32(nPosY[SC_SPLIT_TOP]);
+ pSettings[SC_POSITION_BOTTOM].Name = SC_POSITIONBOTTOM;
+ pSettings[SC_POSITION_BOTTOM].Value <<= sal_Int32(nPosY[SC_SPLIT_BOTTOM]);
+
+ sal_Int32 nZoomValue = long(aZoomY * 100);
+ sal_Int32 nPageZoomValue = long(aPageZoomY * 100);
+ pSettings[SC_TABLE_ZOOM_TYPE].Name = SC_ZOOMTYPE;
+ pSettings[SC_TABLE_ZOOM_TYPE].Value <<= sal_Int16(eZoomType);
+ pSettings[SC_TABLE_ZOOM_VALUE].Name = SC_ZOOMVALUE;
+ pSettings[SC_TABLE_ZOOM_VALUE].Value <<= nZoomValue;
+ pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Name = SC_PAGEVIEWZOOMVALUE;
+ pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue;
+
+ pSettings[SC_TABLE_SHOWGRID].Name = SC_UNO_SHOWGRID;
+ pSettings[SC_TABLE_SHOWGRID].Value <<= bShowGrid;
// Common SdrModel processing
rViewData.GetDocument()->GetDrawLayer()->WriteUserDataSequence(rSettings);
@@ -3215,96 +3213,94 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe
rSettings.realloc(SC_VIEWSETTINGS_COUNT);
// + 1, because we have to put the view id in the sequence
beans::PropertyValue* pSettings = rSettings.getArray();
- if (pSettings)
- {
- sal_uInt16 nViewID(pViewShell->GetViewFrame()->GetCurViewId());
- pSettings[SC_VIEW_ID].Name = SC_VIEWID;
- pSettings[SC_VIEW_ID].Value <<= SC_VIEW + OUString::number(nViewID);
- uno::Reference<container::XNameContainer> xNameContainer =
- document::NamedPropertyValues::create( comphelper::getProcessComponentContext() );
- for (SCTAB nTab=0; nTab<static_cast<SCTAB>(maTabData.size()); nTab++)
+ sal_uInt16 nViewID(pViewShell->GetViewFrame()->GetCurViewId());
+ pSettings[SC_VIEW_ID].Name = SC_VIEWID;
+ pSettings[SC_VIEW_ID].Value <<= SC_VIEW + OUString::number(nViewID);
+
+ uno::Reference<container::XNameContainer> xNameContainer =
+ document::NamedPropertyValues::create( comphelper::getProcessComponentContext() );
+ for (SCTAB nTab=0; nTab<static_cast<SCTAB>(maTabData.size()); nTab++)
+ {
+ if (maTabData[nTab])
{
- if (maTabData[nTab])
+ uno::Sequence <beans::PropertyValue> aTableViewSettings;
+ maTabData[nTab]->WriteUserDataSequence(aTableViewSettings, *this);
+ OUString sTabName;
+ GetDocument()->GetName( nTab, sTabName );
+ try
{
- uno::Sequence <beans::PropertyValue> aTableViewSettings;
- maTabData[nTab]->WriteUserDataSequence(aTableViewSettings, *this);
- OUString sTabName;
- GetDocument()->GetName( nTab, sTabName );
- try
- {
- xNameContainer->insertByName(sTabName, uno::Any(aTableViewSettings));
- }
- //#101739#; two tables with the same name are possible
- catch ( container::ElementExistException& )
- {
- OSL_FAIL("seems there are two tables with the same name");
- }
- catch ( uno::RuntimeException& )
- {
- OSL_FAIL("something went wrong");
- }
+ xNameContainer->insertByName(sTabName, uno::Any(aTableViewSettings));
+ }
+ //#101739#; two tables with the same name are possible
+ catch ( container::ElementExistException& )
+ {
+ OSL_FAIL("seems there are two tables with the same name");
+ }
+ catch ( uno::RuntimeException& )
+ {
+ OSL_FAIL("something went wrong");
}
}
- pSettings[SC_TABLE_VIEWSETTINGS].Name = SC_TABLES;
- pSettings[SC_TABLE_VIEWSETTINGS].Value <<= xNameContainer;
-
- OUString sName;
- GetDocument()->GetName( nTabNo, sName );
- pSettings[SC_ACTIVE_TABLE].Name = SC_ACTIVETABLE;
- pSettings[SC_ACTIVE_TABLE].Value <<= sName;
- pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Name = SC_HORIZONTALSCROLLBARWIDTH;
- pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Value <<= sal_Int32(pView->GetTabBarWidth());
- sal_Int32 nZoomValue = long(pThisTab->aZoomY * 100);
- sal_Int32 nPageZoomValue = long(pThisTab->aPageZoomY * 100);
- pSettings[SC_ZOOM_TYPE].Name = SC_ZOOMTYPE;
- pSettings[SC_ZOOM_TYPE].Value <<= sal_Int16(pThisTab->eZoomType);
- pSettings[SC_ZOOM_VALUE].Name = SC_ZOOMVALUE;
- pSettings[SC_ZOOM_VALUE].Value <<= nZoomValue;
- pSettings[SC_PAGE_VIEW_ZOOM_VALUE].Name = SC_PAGEVIEWZOOMVALUE;
- pSettings[SC_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue;
- pSettings[SC_PAGE_BREAK_PREVIEW].Name = SC_SHOWPAGEBREAKPREVIEW;
- pSettings[SC_PAGE_BREAK_PREVIEW].Value <<= bPagebreak;
-
- if (pOptions)
- {
- pSettings[SC_SHOWZERO].Name = SC_UNO_SHOWZERO;
- pSettings[SC_SHOWZERO].Value <<= pOptions->GetOption( VOPT_NULLVALS );
- pSettings[SC_SHOWNOTES].Name = SC_UNO_SHOWNOTES;
- pSettings[SC_SHOWNOTES].Value <<= pOptions->GetOption( VOPT_NOTES );
- pSettings[SC_SHOWGRID].Name = SC_UNO_SHOWGRID;
- pSettings[SC_SHOWGRID].Value <<= pOptions->GetOption( VOPT_GRID );
- pSettings[SC_GRIDCOLOR].Name = SC_UNO_GRIDCOLOR;
- OUString aColorName;
- Color aColor = pOptions->GetGridColor(&aColorName);
- pSettings[SC_GRIDCOLOR].Value <<= aColor;
- pSettings[SC_SHOWPAGEBR].Name = SC_UNO_SHOWPAGEBR;
- pSettings[SC_SHOWPAGEBR].Value <<= pOptions->GetOption( VOPT_PAGEBREAKS );
- pSettings[SC_COLROWHDR].Name = SC_UNO_COLROWHDR;
- pSettings[SC_COLROWHDR].Value <<= pOptions->GetOption( VOPT_HEADER );
- pSettings[SC_SHEETTABS].Name = SC_UNO_SHEETTABS;
- pSettings[SC_SHEETTABS].Value <<= pOptions->GetOption( VOPT_TABCONTROLS );
- pSettings[SC_OUTLSYMB].Name = SC_UNO_OUTLSYMB;
- pSettings[SC_OUTLSYMB].Value <<= pOptions->GetOption( VOPT_OUTLINER );
- pSettings[SC_VALUE_HIGHLIGHTING].Name = SC_UNO_VALUEHIGH;
- pSettings[SC_VALUE_HIGHLIGHTING].Value <<= pOptions->GetOption( VOPT_SYNTAX );
-
- const ScGridOptions& aGridOpt = pOptions->GetGridOptions();
- pSettings[SC_SNAPTORASTER].Name = SC_UNO_SNAPTORASTER;
- pSettings[SC_SNAPTORASTER].Value <<= aGridOpt.GetUseGridSnap();
- pSettings[SC_RASTERVIS].Name = SC_UNO_RASTERVIS;
- pSettings[SC_RASTERVIS].Value <<= aGridOpt.GetGridVisible();
- pSettings[SC_RASTERRESX].Name = SC_UNO_RASTERRESX;
- pSettings[SC_RASTERRESX].Value <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDrawX() );
- pSettings[SC_RASTERRESY].Name = SC_UNO_RASTERRESY;
- pSettings[SC_RASTERRESY].Value <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDrawY() );
- pSettings[SC_RASTERSUBX].Name = SC_UNO_RASTERSUBX;
- pSettings[SC_RASTERSUBX].Value <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDivisionX() );
- pSettings[SC_RASTERSUBY].Name = SC_UNO_RASTERSUBY;
- pSettings[SC_RASTERSUBY].Value <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDivisionY() );
- pSettings[SC_RASTERSYNC].Name = SC_UNO_RASTERSYNC;
- pSettings[SC_RASTERSYNC].Value <<= aGridOpt.GetSynchronize();
- }
+ }
+ pSettings[SC_TABLE_VIEWSETTINGS].Name = SC_TABLES;
+ pSettings[SC_TABLE_VIEWSETTINGS].Value <<= xNameContainer;
+
+ OUString sName;
+ GetDocument()->GetName( nTabNo, sName );
+ pSettings[SC_ACTIVE_TABLE].Name = SC_ACTIVETABLE;
+ pSettings[SC_ACTIVE_TABLE].Value <<= sName;
+ pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Name = SC_HORIZONTALSCROLLBARWIDTH;
+ pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Value <<= sal_Int32(pView->GetTabBarWidth());
+ sal_Int32 nZoomValue = long(pThisTab->aZoomY * 100);
+ sal_Int32 nPageZoomValue = long(pThisTab->aPageZoomY * 100);
+ pSettings[SC_ZOOM_TYPE].Name = SC_ZOOMTYPE;
+ pSettings[SC_ZOOM_TYPE].Value <<= sal_Int16(pThisTab->eZoomType);
+ pSettings[SC_ZOOM_VALUE].Name = SC_ZOOMVALUE;
+ pSettings[SC_ZOOM_VALUE].Value <<= nZoomValue;
+ pSettings[SC_PAGE_VIEW_ZOOM_VALUE].Name = SC_PAGEVIEWZOOMVALUE;
+ pSettings[SC_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue;
+ pSettings[SC_PAGE_BREAK_PREVIEW].Name = SC_SHOWPAGEBREAKPREVIEW;
+ pSettings[SC_PAGE_BREAK_PREVIEW].Value <<= bPagebreak;
+
+ if (pOptions)
+ {
+ pSettings[SC_SHOWZERO].Name = SC_UNO_SHOWZERO;
+ pSettings[SC_SHOWZERO].Value <<= pOptions->GetOption( VOPT_NULLVALS );
+ pSettings[SC_SHOWNOTES].Name = SC_UNO_SHOWNOTES;
+ pSettings[SC_SHOWNOTES].Value <<= pOptions->GetOption( VOPT_NOTES );
+ pSettings[SC_SHOWGRID].Name = SC_UNO_SHOWGRID;
+ pSettings[SC_SHOWGRID].Value <<= pOptions->GetOption( VOPT_GRID );
+ pSettings[SC_GRIDCOLOR].Name = SC_UNO_GRIDCOLOR;
+ OUString aColorName;
+ Color aColor = pOptions->GetGridColor(&aColorName);
+ pSettings[SC_GRIDCOLOR].Value <<= aColor;
+ pSettings[SC_SHOWPAGEBR].Name = SC_UNO_SHOWPAGEBR;
+ pSettings[SC_SHOWPAGEBR].Value <<= pOptions->GetOption( VOPT_PAGEBREAKS );
+ pSettings[SC_COLROWHDR].Name = SC_UNO_COLROWHDR;
+ pSettings[SC_COLROWHDR].Value <<= pOptions->GetOption( VOPT_HEADER );
+ pSettings[SC_SHEETTABS].Name = SC_UNO_SHEETTABS;
+ pSettings[SC_SHEETTABS].Value <<= pOptions->GetOption( VOPT_TABCONTROLS );
+ pSettings[SC_OUTLSYMB].Name = SC_UNO_OUTLSYMB;
+ pSettings[SC_OUTLSYMB].Value <<= pOptions->GetOption( VOPT_OUTLINER );
+ pSettings[SC_VALUE_HIGHLIGHTING].Name = SC_UNO_VALUEHIGH;
+ pSettings[SC_VALUE_HIGHLIGHTING].Value <<= pOptions->GetOption( VOPT_SYNTAX );
+
+ const ScGridOptions& aGridOpt = pOptions->GetGridOptions();
+ pSettings[SC_SNAPTORASTER].Name = SC_UNO_SNAPTORASTER;
+ pSettings[SC_SNAPTORASTER].Value <<= aGridOpt.GetUseGridSnap();
+ pSettings[SC_RASTERVIS].Name = SC_UNO_RASTERVIS;
+ pSettings[SC_RASTERVIS].Value <<= aGridOpt.GetGridVisible();
+ pSettings[SC_RASTERRESX].Name = SC_UNO_RASTERRESX;
+ pSettings[SC_RASTERRESX].Value <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDrawX() );
+ pSettings[SC_RASTERRESY].Name = SC_UNO_RASTERRESY;
+ pSettings[SC_RASTERRESY].Value <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDrawY() );
+ pSettings[SC_RASTERSUBX].Name = SC_UNO_RASTERSUBX;
+ pSettings[SC_RASTERSUBX].Value <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDivisionX() );
+ pSettings[SC_RASTERSUBY].Name = SC_UNO_RASTERSUBY;
+ pSettings[SC_RASTERSUBY].Value <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDivisionY() );
+ pSettings[SC_RASTERSYNC].Name = SC_UNO_RASTERSYNC;
+ pSettings[SC_RASTERSYNC].Value <<= aGridOpt.GetSynchronize();
}
// Common SdrModel processing
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 9b1d7b1fe507..a5e2cb63a457 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1727,39 +1727,36 @@ void SfxViewFrame::MakeActive_Impl( bool bGrabFocus )
{
if ( IsVisible() )
{
- if ( GetViewShell() )
+ bool bPreview = false;
+ if (GetObjectShell()->IsPreview())
{
- bool bPreview = false;
- if ( GetObjectShell()->IsPreview() )
- {
- bPreview = true;
- }
+ bPreview = true;
+ }
- css::uno::Reference< css::frame::XFrame > xFrame = GetFrame().GetFrameInterface();
- if ( !bPreview )
- {
- SetViewFrame( this );
- GetBindings().SetActiveFrame( css::uno::Reference< css::frame::XFrame >() );
- uno::Reference< frame::XFramesSupplier > xSupp( xFrame, uno::UNO_QUERY );
- if ( xSupp.is() )
- xSupp->setActiveFrame( uno::Reference < frame::XFrame >() );
-
- css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow();
- VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xContainerWindow);
- if (pWindow && pWindow->HasChildPathFocus() && bGrabFocus)
- {
- SfxInPlaceClient *pCli = GetViewShell()->GetUIActiveClient();
- if ( !pCli || !pCli->IsObjectUIActive() )
- GetFrame().GrabFocusOnComponent_Impl();
- }
- }
- else
+ css::uno::Reference<css::frame::XFrame> xFrame = GetFrame().GetFrameInterface();
+ if (!bPreview)
+ {
+ SetViewFrame(this);
+ GetBindings().SetActiveFrame(css::uno::Reference<css::frame::XFrame>());
+ uno::Reference<frame::XFramesSupplier> xSupp(xFrame, uno::UNO_QUERY);
+ if (xSupp.is())
+ xSupp->setActiveFrame(uno::Reference<frame::XFrame>());
+
+ css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow();
+ VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xContainerWindow);
+ if (pWindow && pWindow->HasChildPathFocus() && bGrabFocus)
{
- GetBindings().SetDispatcher( GetDispatcher() );
- GetBindings().SetActiveFrame( css::uno::Reference< css::frame::XFrame > () );
- GetDispatcher()->Update_Impl();
+ SfxInPlaceClient *pCli = GetViewShell()->GetUIActiveClient();
+ if (!pCli || !pCli->IsObjectUIActive())
+ GetFrame().GrabFocusOnComponent_Impl();
}
}
+ else
+ {
+ GetBindings().SetDispatcher(GetDispatcher());
+ GetBindings().SetActiveFrame(css::uno::Reference<css::frame::XFrame>());
+ GetDispatcher()->Update_Impl();
+ }
}
}
}
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index af3b990234a5..a32995957ab6 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -164,16 +164,16 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq )
if ( bShow )
{
// First, make the floats viewable
- pWorkWin->MakeChildrenVisible_Impl( bShow );
+ pWorkWin->MakeChildrenVisible_Impl(true);
GetDispatcher()->Update_Impl( true );
// Then view it
- GetBindings().HidePopups( !bShow );
+ GetBindings().HidePopups(false);
}
else
{
- pWorkWin->HidePopups_Impl( !bShow );
- pWorkWin->MakeChildrenVisible_Impl( bShow );
+ pWorkWin->HidePopups_Impl(true);
+ pWorkWin->MakeChildrenVisible_Impl(false);
}
Invalidate( rReq.GetSlot() );
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index a618d2882b77..cbe3b3b11ac0 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -68,9 +68,7 @@ SmSym& SmSym::operator = (const SmSym& rSymbol)
m_aSetName = rSymbol.m_aSetName;
m_bPredefined = rSymbol.m_bPredefined;
- SmSymbolManager * pSymSetManager = &SM_MOD()->GetSymbolManager();
- if (pSymSetManager)
- pSymSetManager->SetModified(true);
+ SM_MOD()->GetSymbolManager().SetModified(true);
return *this;
}
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index cb39faeb6eba..4ffd7622f835 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -186,8 +186,7 @@ SwUserFieldType::SwUserFieldType( SwDoc* pDocPtr, const OUString& aNam )
bValidValue = bDeleted = false;
aName = aNam;
- if (nType & nsSwGetSetExpType::GSE_STRING)
- EnableFormat(false); // Do not use a Numberformatter
+ EnableFormat(false); // Do not use a Numberformatter for nsSwGetSetExpType::GSE_STRING
}
OUString SwUserFieldType::Expand(sal_uInt32 nFormat, sal_uInt16 nSubType, LanguageType nLng)
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 24073bd25a03..fae13fa81339 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -340,17 +340,15 @@ void SwXMLExport::ExportFontDecls_()
SvXMLExport::ExportFontDecls_();
}
-#define NUM_EXPORTED_VIEW_SETTINGS 11
void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
{
- aProps.realloc( NUM_EXPORTED_VIEW_SETTINGS );
+ aProps.realloc(7);
// Currently exporting 9 properties
PropertyValue *pValue = aProps.getArray();
- sal_Int32 nIndex = 0;
Reference < XIndexContainer > xBox = IndexedPropertyValues::create( comphelper::getProcessComponentContext() );
- pValue[nIndex].Name = "Views";
- pValue[nIndex++].Value <<= xBox;
+ pValue[0].Name = "Views";
+ pValue[0].Value <<= xBox;
SwDoc *pDoc = getDoc();
const tools::Rectangle rRect =
@@ -359,17 +357,17 @@ void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
OSL_ENSURE( bTwip, "Map unit for visible area is not in TWIPS!" );
- pValue[nIndex].Name = "ViewAreaTop";
- pValue[nIndex++].Value <<= bTwip ? convertTwipToMm100 ( rRect.Top() ) : rRect.Top();
+ pValue[1].Name = "ViewAreaTop";
+ pValue[1].Value <<= bTwip ? convertTwipToMm100 ( rRect.Top() ) : rRect.Top();
- pValue[nIndex].Name = "ViewAreaLeft";
- pValue[nIndex++].Value <<= bTwip ? convertTwipToMm100 ( rRect.Left() ) : rRect.Left();
+ pValue[2].Name = "ViewAreaLeft";
+ pValue[2].Value <<= bTwip ? convertTwipToMm100 ( rRect.Left() ) : rRect.Left();
- pValue[nIndex].Name = "ViewAreaWidth";
- pValue[nIndex++].Value <<= bTwip ? convertTwipToMm100 ( rRect.GetWidth() ) : rRect.GetWidth();
+ pValue[3].Name = "ViewAreaWidth";
+ pValue[3].Value <<= bTwip ? convertTwipToMm100 ( rRect.GetWidth() ) : rRect.GetWidth();
- pValue[nIndex].Name = "ViewAreaHeight";
- pValue[nIndex++].Value <<= bTwip ? convertTwipToMm100 ( rRect.GetHeight() ) : rRect.GetHeight();
+ pValue[4].Name = "ViewAreaHeight";
+ pValue[4].Value <<= bTwip ? convertTwipToMm100 ( rRect.GetHeight() ) : rRect.GetHeight();
// "show redline mode" cannot simply be read from the document
// since it gets changed during execution. If it's in the info
@@ -386,16 +384,12 @@ void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
}
}
- pValue[nIndex].Name = "ShowRedlineChanges";
- pValue[nIndex++].Value <<= bShowRedlineChanges;
+ pValue[5].Name = "ShowRedlineChanges";
+ pValue[5].Value <<= bShowRedlineChanges;
- pValue[nIndex].Name = "InBrowseMode";
- pValue[nIndex++].Value <<= pDoc->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE);
-
- if ( nIndex < NUM_EXPORTED_VIEW_SETTINGS )
- aProps.realloc(nIndex);
+ pValue[6].Name = "InBrowseMode";
+ pValue[6].Value <<= pDoc->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE);
}
-#undef NUM_EXPORTED_VIEW_SETTINGS
void SwXMLExport::GetConfigurationSettings( Sequence < PropertyValue >& rProps)
{
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 8d7681adde1e..b786ecb5a88d 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -277,8 +277,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
if ( pMarginItem )
aMargin = pMarginItem->GetSize();
- if ( pURLItem )
- xSet->setPropertyValue("FrameURL", uno::makeAny( pURLItem->GetValue() ) );
+ xSet->setPropertyValue("FrameURL", uno::makeAny( pURLItem->GetValue() ) );
if ( pNameItem )
xSet->setPropertyValue("FrameName", uno::makeAny( pNameItem->GetValue() ) );
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index d11f9d9e6f7a..b0073017e810 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -194,8 +194,6 @@ StyleSet setupThemes()
void changeFont(SwFormat* pFormat, SwDocStyleSheet const * pStyle, FontSet const & rFontSet)
{
- bool bChanged = false;
-
if (pStyle->GetName() != "Default Style" && pFormat->GetAttrSet().GetItem(RES_CHRATR_FONT, false) == nullptr)
{
return;
@@ -208,26 +206,20 @@ void changeFont(SwFormat* pFormat, SwDocStyleSheet const * pStyle, FontSet const
if (ePitch == PITCH_FIXED)
{
aFontItem.SetFamilyName(rFontSet.msMonoFont);
- bChanged = true;
}
else
{
if (pStyle->GetName() == "Heading")
{
aFontItem.SetFamilyName(rFontSet.msHeadingFont);
- bChanged = true;
}
else
{
aFontItem.SetFamilyName(rFontSet.msBaseFont);
- bChanged = true;
}
}
- if (bChanged)
- {
- pFormat->SetFormatAttr(aFontItem);
- }
+ pFormat->SetFormatAttr(aFontItem);
}
/*void changeBorder(SwTextFormatColl* pCollection, SwDocStyleSheet* pStyle, StyleSet& rStyleSet)
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx
index a00686c468da..8d1707761ab6 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -470,13 +470,9 @@ bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter )
{
bRet = true;
// At first run the possibly set ObjectSelect Macro
- const SvxMacro* pMac = &pFnd->GetMacro().GetMacro( SvMacroItemId::OnClick );
- if( pMac )
- {
- SwCallMouseEvent aCallEvent;
- aCallEvent.Set( EVENT_OBJECT_URLITEM, pFnd );
- GetDoc()->CallEvent( SvMacroItemId::OnClick, aCallEvent );
- }
+ SwCallMouseEvent aCallEvent;
+ aCallEvent.Set(EVENT_OBJECT_URLITEM, pFnd);
+ GetDoc()->CallEvent(SvMacroItemId::OnClick, aCallEvent);
::LoadURL(*this, sURL, nFilter, sTargetFrameName);
}
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index a52eaf80e6fc..48bdcc77d574 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -412,8 +412,7 @@ void UnoControl::propertiesChange( const Sequence< PropertyChangeEvent >& rEvent
for ( ; pEvents < pEventsEnd; )
if ( mpData->aSuspendedPropertyNotifications.find( pEvents->PropertyName ) != mpData->aSuspendedPropertyNotifications.end() )
{
- if ( pEvents != pEventsEnd )
- ::std::copy( pEvents + 1, pEventsEnd, pEvents );
+ std::copy(pEvents + 1, pEventsEnd, pEvents);
--pEventsEnd;
}
else
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 149aa0b99ef6..0ed1ac2e1414 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4945,69 +4945,69 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
}
}
- if( pToolItem )
- {
- ImplToolItems::size_type pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems );
- ImplToolItems::size_type nCount = mpData->m_aItems.size();
+ assert(pToolItem);
+
+ ImplToolItems::size_type pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems );
+ ImplToolItems::size_type nCount = mpData->m_aItems.size();
- ImplToolItems::size_type i=0;
- do
+ ImplToolItems::size_type i=0;
+ do
+ {
+ if( bUp )
{
- if( bUp )
+ if( !pos-- )
{
- if( !pos-- )
- {
- if( bNoCycle )
- return false;
+ if( bNoCycle )
+ return false;
- // highlight the menu button if it is the last item
- if( IsMenuEnabled() && !ImplIsFloatingMode() )
- {
- ImplChangeHighlight( nullptr );
- InvalidateMenuButton();
- return true;
- }
- else
- pos = nCount-1;
+ // highlight the menu button if it is the last item
+ if( IsMenuEnabled() && !ImplIsFloatingMode() )
+ {
+ ImplChangeHighlight( nullptr );
+ InvalidateMenuButton();
+ return true;
}
+ else
+ pos = nCount-1;
}
- else
+ }
+ else
+ {
+ if( ++pos >= nCount )
{
- if( ++pos >= nCount )
- {
- if( bNoCycle )
- return false;
+ if( bNoCycle )
+ return false;
- // highlight the menu button if it is the last item
- if( IsMenuEnabled() && !ImplIsFloatingMode() )
- {
- ImplChangeHighlight( nullptr );
- InvalidateMenuButton();
- return true;
- }
- else
- pos = 0;
+ // highlight the menu button if it is the last item
+ if( IsMenuEnabled() && !ImplIsFloatingMode() )
+ {
+ ImplChangeHighlight( nullptr );
+ InvalidateMenuButton();
+ return true;
}
+ else
+ pos = 0;
}
+ }
- pToolItem = &mpData->m_aItems[pos];
+ pToolItem = &mpData->m_aItems[pos];
- if ( ImplIsValidItem( pToolItem, false ) )
- break;
+ if ( ImplIsValidItem( pToolItem, false ) )
+ break;
- } while( ++i < nCount);
+ } while( ++i < nCount);
- if( pToolItem->IsClipped() && IsMenuEnabled() )
- {
- // select the menu button if a clipped item would be selected
- ImplChangeHighlight( nullptr );
- InvalidateMenuButton();
- }
- else if( i != nCount )
- ImplChangeHighlight( pToolItem );
- else
- return false;
+ if( pToolItem->IsClipped() && IsMenuEnabled() )
+ {
+ // select the menu button if a clipped item would be selected
+ ImplChangeHighlight( nullptr );
+ InvalidateMenuButton();
}
+ else if( i != nCount )
+ ImplChangeHighlight( pToolItem );
+ else
+ return false;
+
return true;
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index fc56c4d09d29..4f3810dc3d02 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2611,9 +2611,7 @@ void Window::AlwaysEnableInput( bool bAlways, bool bChild )
if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled )
{
mpWindowImpl->meAlwaysInputMode = AlwaysInputEnabled;
-
- if ( bAlways )
- EnableInput( true, false );
+ EnableInput(true, false);
}
else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled )
{
@@ -2640,9 +2638,7 @@ void Window::AlwaysDisableInput( bool bAlways, bool bChild )
if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputDisabled )
{
mpWindowImpl->meAlwaysInputMode = AlwaysInputDisabled;
-
- if ( bAlways )
- EnableInput( false, false );
+ EnableInput(false, false);
}
else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled )
{
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 32f52d1df45c..29fe7d2c19c2 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1773,19 +1773,15 @@ IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl, void*, void)
pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
// call the Deactivate
- vcl::Window* pOldFocusWindow = pFocusWin;
- if ( pOldFocusWindow )
- {
- vcl::Window* pOldOverlapWindow = pOldFocusWindow->ImplGetFirstOverlapWindow();
- vcl::Window* pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
+ vcl::Window* pOldOverlapWindow = pFocusWin->ImplGetFirstOverlapWindow();
+ vcl::Window* pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
- pOldOverlapWindow->ImplGetWindowImpl()->mbActive = false;
- pOldOverlapWindow->Deactivate();
- if ( pOldRealWindow != pOldOverlapWindow )
- {
- pOldRealWindow->ImplGetWindowImpl()->mbActive = false;
- pOldRealWindow->Deactivate();
- }
+ pOldOverlapWindow->ImplGetWindowImpl()->mbActive = false;
+ pOldOverlapWindow->Deactivate();
+ if ( pOldRealWindow != pOldOverlapWindow )
+ {
+ pOldRealWindow->ImplGetWindowImpl()->mbActive = false;
+ pOldRealWindow->Deactivate();
}
// TrackingMode is ended in ImplHandleLoseFocus
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index e2b53261c9ef..71204b072c85 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -135,21 +135,10 @@ bool WinFontInstance::CacheGlyphToAtlas(HDC hDC, HFONT hFont, int nGlyphIndex, S
UINT nPos = 0;
- // FIXME: really I don't get why 'vertical' makes any difference [!] what does it mean !?
- if (aElement.mbVertical)
- {
- aElement.maLocation.SetLeft(0);
- aElement.maLocation.SetRight(nBitmapWidth);
- aElement.maLocation.SetTop(nPos);
- aElement.maLocation.SetBottom( nPos + aGlyphAdv[0] + aElement.maLeftOverhangs );
- }
- else
- {
- aElement.maLocation.SetLeft(nPos);
- aElement.maLocation.SetRight(aEnds[0]);
- aElement.maLocation.SetTop(0);
- aElement.maLocation.SetBottom( bounds.getHeight() + aElement.getExtraSpace() );
- }
+ aElement.maLocation.SetLeft(nPos);
+ aElement.maLocation.SetRight(aEnds[0]);
+ aElement.maLocation.SetTop(0);
+ aElement.maLocation.SetBottom(bounds.getHeight() + aElement.getExtraSpace());
nPos = aEnds[0];
OpenGLCompatibleDC aDC(rGraphics, 0, 0, nBitmapWidth, nBitmapHeight);
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 57826fc6546e..a2303e170b0f 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1627,26 +1627,15 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles )
if (pAutoStyles && mxNumberStyles.is() && (mnImportFlags & SvXMLImportFlags::CONTENT) )
{
uno::Reference<xml::sax::XAttributeList> xAttrList;
- uno::Sequence< OUString > aNames = mxNumberStyles->getElementNames();
- sal_uInt32 nCount(aNames.getLength());
- if (nCount)
+ for (const auto& name : mxNumberStyles->getElementNames())
{
- const OUString* pNames = aNames.getConstArray();
- if ( pNames )
+ uno::Any aAny(mxNumberStyles->getByName(name));
+ sal_Int32 nKey(0);
+ if (aAny >>= nKey)
{
- SvXMLStyleContext* pContext;
- uno::Any aAny;
- sal_Int32 nKey(0);
- for (sal_uInt32 i = 0; i < nCount; i++, pNames++)
- {
- aAny = mxNumberStyles->getByName(*pNames);
- if (aAny >>= nKey)
- {
- pContext = new SvXMLNumFormatContext( *this, XML_NAMESPACE_NUMBER,
- *pNames, xAttrList, nKey, *pAutoStyles );
- pAutoStyles->AddStyle(*pContext);
- }
- }
+ SvXMLStyleContext* pContext = new SvXMLNumFormatContext(
+ *this, XML_NAMESPACE_NUMBER, name, xAttrList, nKey, *pAutoStyles);
+ pAutoStyles->AddStyle(*pContext);
}
}
}
More information about the Libreoffice-commits
mailing list