summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-30 19:35:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-03 08:41:11 +0200
commitd3971ec256450e6783920b46f672048b29719949 (patch)
treef4722d0e2bc321cf71b49b7573cf38640e9b28fc
parentf50bf3c5225b49b3c6f77f882e35305e5dc5ccd3 (diff)
new loplugin:blockblock
Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd Reviewed-on: https://gerrit.libreoffice.org/43025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--basctl/source/dlged/dlged.cxx88
-rw-r--r--compilerplugins/clang/blockblock.cxx71
-rw-r--r--compilerplugins/clang/test/blockblock.cxx18
-rw-r--r--connectivity/source/drivers/hsqldb/HUsers.cxx16
-rw-r--r--connectivity/source/parse/sqlnode.cxx28
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx30
-rw-r--r--dbaccess/source/core/api/tablecontainer.cxx10
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx119
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx20
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx12
-rw-r--r--editeng/source/misc/svxacorr.cxx11
-rw-r--r--embeddedobj/source/commonembedding/embedobj.cxx94
-rw-r--r--filter/source/graphicfilter/icgm/bitmap.cxx20
-rw-r--r--filter/source/svg/svgwriter.cxx60
-rw-r--r--framework/source/accelerators/documentacceleratorconfiguration.cxx24
-rw-r--r--framework/source/services/autorecovery.cxx12
-rw-r--r--package/source/zippackage/zipfileaccess.cxx16
-rw-r--r--reportdesign/source/core/api/ReportEngineJFree.cxx6
-rw-r--r--sal/osl/unx/file.cxx26
-rw-r--r--sc/source/core/data/documen5.cxx50
-rw-r--r--sc/source/ui/view/tabview3.cxx6
-rw-r--r--sd/source/filter/eppt/pptexanimations.cxx6
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx42
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx126
-rw-r--r--sfx2/source/appl/sfxhelp.cxx10
-rw-r--r--sfx2/source/bastyp/progress.cxx10
-rw-r--r--solenv/CompilerTest_compilerplugins_clang.mk1
-rw-r--r--svl/source/fsstor/fsstorage.cxx14
-rw-r--r--svtools/source/uno/unocontroltablemodel.cxx8
-rw-r--r--svx/source/accessibility/svxpixelctlaccessiblecontext.cxx12
-rw-r--r--svx/source/form/ParseContext.cxx8
-rw-r--r--svx/source/svdraw/svdovirt.cxx14
-rw-r--r--sw/source/core/doc/DocumentLayoutManager.cxx18
-rw-r--r--sw/source/core/doc/DocumentStylePoolManager.cxx4
-rw-r--r--sw/source/core/doc/tblrwcl.cxx20
-rw-r--r--sw/source/core/docnode/ndtbl.cxx26
-rw-r--r--sw/source/core/docnode/nodes.cxx54
-rw-r--r--sw/source/core/unocore/unotbl.cxx24
-rw-r--r--sw/source/filter/xml/xmltexte.cxx33
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx36
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx38
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx9
-rw-r--r--sw/source/uibase/shells/textsh1.cxx20
-rw-r--r--sw/source/uibase/wrtsh/select.cxx16
-rw-r--r--tools/qa/cppunit/test_color.cxx20
-rw-r--r--tools/qa/cppunit/test_inetmime.cxx198
-rw-r--r--tools/source/generic/poly.cxx50
-rw-r--r--unotools/qa/unit/testGetEnglishSearchName.cxx43
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx84
-rw-r--r--xmloff/source/core/xmlexp.cxx11
-rw-r--r--xmloff/source/draw/animationimport.cxx26
52 files changed, 849 insertions, 873 deletions
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 3f904c96a991..caadc73d24ff 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -1143,56 +1143,54 @@ void DlgEditor::printPage( sal_Int32 nPage, Printer* pPrinter, const OUString& r
void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not working yet
{
- {
- MapMode aOldMap( pPrinter->GetMapMode());
- vcl::Font aOldFont( pPrinter->GetFont() );
-
- MapMode aMap( MapUnit::Map100thMM );
- pPrinter->SetMapMode( aMap );
- vcl::Font aFont;
- aFont.SetAlignment( ALIGN_BOTTOM );
- aFont.SetFontSize( Size( 0, 360 ));
- pPrinter->SetFont( aFont );
-
- Size aPaperSz = pPrinter->GetOutputSize();
- aPaperSz.Width() -= (Print::nLeftMargin + Print::nRightMargin);
- aPaperSz.Height() -= (Print::nTopMargin + Print::nBottomMargin);
-
- lcl_PrintHeader( pPrinter, rTitle );
-
- Bitmap aDlg;
- Size aBmpSz( pPrinter->PixelToLogic( aDlg.GetSizePixel() ) );
- double nPaperSzWidth = aPaperSz.Width();
- double nPaperSzHeight = aPaperSz.Height();
- double nBmpSzWidth = aBmpSz.Width();
- double nBmpSzHeight = aBmpSz.Height();
- double nScaleX = (nPaperSzWidth / nBmpSzWidth );
- double nScaleY = (nPaperSzHeight / nBmpSzHeight );
-
- Size aOutputSz;
- if( nBmpSzHeight * nScaleX <= nPaperSzHeight )
- {
- aOutputSz.Width() = (long)(nBmpSzWidth * nScaleX);
- aOutputSz.Height() = (long)(nBmpSzHeight * nScaleX);
- }
- else
- {
- aOutputSz.Width() = (long)(nBmpSzWidth * nScaleY);
- aOutputSz.Height() = (long)(nBmpSzHeight * nScaleY);
- }
+ MapMode aOldMap( pPrinter->GetMapMode());
+ vcl::Font aOldFont( pPrinter->GetFont() );
+
+ MapMode aMap( MapUnit::Map100thMM );
+ pPrinter->SetMapMode( aMap );
+ vcl::Font aFont;
+ aFont.SetAlignment( ALIGN_BOTTOM );
+ aFont.SetFontSize( Size( 0, 360 ));
+ pPrinter->SetFont( aFont );
- Point aPosOffs(
- (aPaperSz.Width() / 2) - (aOutputSz.Width() / 2),
- (aPaperSz.Height()/ 2) - (aOutputSz.Height() / 2));
+ Size aPaperSz = pPrinter->GetOutputSize();
+ aPaperSz.Width() -= (Print::nLeftMargin + Print::nRightMargin);
+ aPaperSz.Height() -= (Print::nTopMargin + Print::nBottomMargin);
- aPosOffs.X() += Print::nLeftMargin;
- aPosOffs.Y() += Print::nTopMargin;
+ lcl_PrintHeader( pPrinter, rTitle );
- pPrinter->DrawBitmap( aPosOffs, aOutputSz, aDlg );
+ Bitmap aDlg;
+ Size aBmpSz( pPrinter->PixelToLogic( aDlg.GetSizePixel() ) );
+ double nPaperSzWidth = aPaperSz.Width();
+ double nPaperSzHeight = aPaperSz.Height();
+ double nBmpSzWidth = aBmpSz.Width();
+ double nBmpSzHeight = aBmpSz.Height();
+ double nScaleX = (nPaperSzWidth / nBmpSzWidth );
+ double nScaleY = (nPaperSzHeight / nBmpSzHeight );
- pPrinter->SetMapMode( aOldMap );
- pPrinter->SetFont( aOldFont );
+ Size aOutputSz;
+ if( nBmpSzHeight * nScaleX <= nPaperSzHeight )
+ {
+ aOutputSz.Width() = (long)(nBmpSzWidth * nScaleX);
+ aOutputSz.Height() = (long)(nBmpSzHeight * nScaleX);
+ }
+ else
+ {
+ aOutputSz.Width() = (long)(nBmpSzWidth * nScaleY);
+ aOutputSz.Height() = (long)(nBmpSzHeight * nScaleY);
}
+
+ Point aPosOffs(
+ (aPaperSz.Width() / 2) - (aOutputSz.Width() / 2),
+ (aPaperSz.Height()/ 2) - (aOutputSz.Height() / 2));
+
+ aPosOffs.X() += Print::nLeftMargin;
+ aPosOffs.Y() += Print::nTopMargin;
+
+ pPrinter->DrawBitmap( aPosOffs, aOutputSz, aDlg );
+
+ pPrinter->SetMapMode( aOldMap );
+ pPrinter->SetFont( aOldFont );
}
diff --git a/compilerplugins/clang/blockblock.cxx b/compilerplugins/clang/blockblock.cxx
new file mode 100644
index 000000000000..43e9b94deedb
--- /dev/null
+++ b/compilerplugins/clang/blockblock.cxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <cassert>
+#include <string>
+#include <iostream>
+#include <fstream>
+#include <set>
+#include "plugin.hxx"
+
+/**
+ Check for places where we declare a block directly inside a block
+ */
+namespace {
+
+class BlockBlock:
+ public RecursiveASTVisitor<BlockBlock>, public loplugin::RewritePlugin
+{
+public:
+ explicit BlockBlock(InstantiationData const & data): RewritePlugin(data) {}
+
+ virtual void run() override
+ {
+ StringRef fn( compiler.getSourceManager().getFileEntryForID(
+ compiler.getSourceManager().getMainFileID())->getName() );
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/osl/unx/file_misc.cxx"))
+ return;
+
+ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+ }
+
+ bool VisitCompoundStmt(CompoundStmt const * );
+};
+
+bool BlockBlock::VisitCompoundStmt(CompoundStmt const * compound)
+{
+ if (ignoreLocation(compound))
+ return true;
+ if (compound->size() != 1)
+ return true;
+ auto inner = *compound->body_begin();
+ if (!isa<CompoundStmt>(inner))
+ return true;
+ if (compiler.getSourceManager().isMacroBodyExpansion(compound->getLocStart()))
+ return true;
+ if (compiler.getSourceManager().isMacroBodyExpansion(inner->getLocStart()))
+ return true;
+ report(
+ DiagnosticsEngine::Warning,
+ "block directly inside block",
+ compound->getLocStart())
+ << compound->getSourceRange();
+ report(
+ DiagnosticsEngine::Note,
+ "inner block here",
+ inner->getLocStart())
+ << inner->getSourceRange();
+ return true;
+}
+
+loplugin::Plugin::Registration< BlockBlock > X("blockblock", true);
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/compilerplugins/clang/test/blockblock.cxx b/compilerplugins/clang/test/blockblock.cxx
new file mode 100644
index 000000000000..d81f9fe527ae
--- /dev/null
+++ b/compilerplugins/clang/test/blockblock.cxx
@@ -0,0 +1,18 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+
+int main() { // expected-error {{block directly inside block [loplugin:blockblock]}}
+ { // expected-note {{inner block here [loplugin:blockblock]}}
+ int x = 1;
+ (void)x;
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/connectivity/source/drivers/hsqldb/HUsers.cxx b/connectivity/source/drivers/hsqldb/HUsers.cxx
index 812d8edcd237..424cf0670d3d 100644
--- a/connectivity/source/drivers/hsqldb/HUsers.cxx
+++ b/connectivity/source/drivers/hsqldb/HUsers.cxx
@@ -89,16 +89,14 @@ sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Referen
// XDrop
void OUsers::dropObject(sal_Int32 /*nPos*/,const OUString& _sElementName)
{
- {
- OUString aSql( "REVOKE ALL ON * FROM " );
- OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
- aSql += ::dbtools::quoteName(aQuote,_sElementName);
+ OUString aSql( "REVOKE ALL ON * FROM " );
+ OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
+ aSql += ::dbtools::quoteName(aQuote,_sElementName);
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
- if(xStmt.is())
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
+ Reference< XStatement > xStmt = m_xConnection->createStatement( );
+ if(xStmt.is())
+ xStmt->execute(aSql);
+ ::comphelper::disposeComponent(xStmt);
}
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index b7464836e90b..b5a32548af1f 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1463,25 +1463,23 @@ OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >&
OSQLParser::~OSQLParser()
{
+ ::osl::MutexGuard aGuard(getMutex());
+ OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
+ if (!--s_nRefCount)
{
- ::osl::MutexGuard aGuard(getMutex());
- OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
- if (!--s_nRefCount)
- {
- s_pScanner->setScanner(true);
- delete s_pScanner;
- s_pScanner = nullptr;
+ s_pScanner->setScanner(true);
+ delete s_pScanner;
+ s_pScanner = nullptr;
- delete s_pGarbageCollector;
- s_pGarbageCollector = nullptr;
- // Is only set the first time, so we should delete it only when there are no more instances
- s_xLocaleData = nullptr;
+ delete s_pGarbageCollector;
+ s_pGarbageCollector = nullptr;
+ // Is only set the first time, so we should delete it only when there are no more instances
+ s_xLocaleData = nullptr;
- RuleIDMap aEmpty;
- s_aReverseRuleIDLookup.swap( aEmpty );
- }
- m_pParseTree = nullptr;
+ RuleIDMap aEmpty;
+ s_aReverseRuleIDLookup.swap( aEmpty );
}
+ m_pParseTree = nullptr;
}
void OSQLParseNode::substituteParameterNames(OSQLParseNode const * _pNode)
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index f12851c2d1da..15948bc4a6b5 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -1820,24 +1820,20 @@ sal_uInt16 SvxSwPosSizeTabPage::FillPosLB(FrmMap *_pMap,
std::size_t nCount = ::lcl_GetFrmMapCount(_pMap);
for (std::size_t i = 0; _pMap && i < nCount; ++i)
{
-// #61359# why not from the left/from inside or from the top?
-// if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP))
+ SvxSwFramePosString::StringId eStrId = m_pHoriMirrorCB->IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
+ eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, m_bIsVerticalFrame, m_bIsInRightToLeft);
+ OUString sEntry(SvxSwFramePosString::GetString(eStrId));
+ if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
{
- SvxSwFramePosString::StringId eStrId = m_pHoriMirrorCB->IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
- eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, m_bIsVerticalFrame, m_bIsInRightToLeft);
- OUString sEntry(SvxSwFramePosString::GetString(eStrId));
- if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
- {
- // don't insert duplicate entries at character wrapped borders
- _rLB.InsertEntry(sEntry);
- }
- // #i22341# - add condition to handle map <aVCharMap>
- // that is ambiguous in the alignment.
- if ( _pMap[i].nAlign == _nAlign &&
- ( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
- {
- sSelEntry = sEntry;
- }
+ // don't insert duplicate entries at character wrapped borders
+ _rLB.InsertEntry(sEntry);
+ }
+ // #i22341# - add condition to handle map <aVCharMap>
+ // that is ambiguous in the alignment.
+ if ( _pMap[i].nAlign == _nAlign &&
+ ( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
+ {
+ sSelEntry = sEntry;
}
}
diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx
index a7ce9d8981e2..afd6dab6852b 100644
--- a/dbaccess/source/core/api/tablecontainer.cxx
+++ b/dbaccess/source/core/api/tablecontainer.cxx
@@ -414,13 +414,11 @@ void SAL_CALL OTableContainer::elementRemoved( const ContainerEvent& /*Event*/ )
void SAL_CALL OTableContainer::elementReplaced( const ContainerEvent& Event )
{
// create a new config entry
- {
- OUString sOldComposedName,sNewComposedName;
- Event.ReplacedElement >>= sOldComposedName;
- Event.Accessor >>= sNewComposedName;
+ OUString sOldComposedName,sNewComposedName;
+ Event.ReplacedElement >>= sOldComposedName;
+ Event.Accessor >>= sNewComposedName;
- renameObject(sOldComposedName,sNewComposedName);
- }
+ renameObject(sOldComposedName,sNewComposedName);
}
void SAL_CALL OTableContainer::disposing()
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 360876726591..c61e4b7ae9e3 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1300,78 +1300,75 @@ void ODocumentDefinition::saveAs()
}
try
{
- {
- ::SolarMutexGuard aSolarGuard;
-
- // the request
- DocumentSaveRequest aRequest;
- aRequest.Name = m_pImpl->m_aProps.aTitle;
-
- aRequest.Content.set(m_xParentContainer,UNO_QUERY);
- OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest));
- Reference< XInteractionRequest > xRequest(pRequest);
- // some knittings
- // two continuations allowed: OK and Cancel
- ODocumentSaveContinuation* pDocuSave = new ODocumentSaveContinuation;
- pRequest->addContinuation(pDocuSave);
- OInteraction< XInteractionDisapprove >* pDisApprove = new OInteraction< XInteractionDisapprove >;
- pRequest->addContinuation(pDisApprove);
- OInteractionAbort* pAbort = new OInteractionAbort;
- pRequest->addContinuation(pAbort);
-
- // create the handler, let it handle the request
- Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext, nullptr) );
- xHandler->handle(xRequest);
+ ::SolarMutexGuard aSolarGuard;
- if ( pAbort->wasSelected() )
- return;
- if ( pDisApprove->wasSelected() )
- return;
- if ( pDocuSave->wasSelected() )
+ // the request
+ DocumentSaveRequest aRequest;
+ aRequest.Name = m_pImpl->m_aProps.aTitle;
+
+ aRequest.Content.set(m_xParentContainer,UNO_QUERY);
+ OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest));
+ Reference< XInteractionRequest > xRequest(pRequest);
+ // some knittings
+ // two continuations allowed: OK and Cancel
+ ODocumentSaveContinuation* pDocuSave = new ODocumentSaveContinuation;
+ pRequest->addContinuation(pDocuSave);
+ OInteraction< XInteractionDisapprove >* pDisApprove = new OInteraction< XInteractionDisapprove >;
+ pRequest->addContinuation(pDisApprove);
+ OInteractionAbort* pAbort = new OInteractionAbort;
+ pRequest->addContinuation(pAbort);
+
+ // create the handler, let it handle the request
+ Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext, nullptr) );
+ xHandler->handle(xRequest);
+
+ if ( pAbort->wasSelected() )
+ return;
+ if ( pDisApprove->wasSelected() )
+ return;
+ if ( pDocuSave->wasSelected() )
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ Reference<XNameContainer> xNC(pDocuSave->getContent(),UNO_QUERY);
+ if ( xNC.is() )
{
- ::osl::MutexGuard aGuard(m_aMutex);
- Reference<XNameContainer> xNC(pDocuSave->getContent(),UNO_QUERY);
- if ( xNC.is() )
+ if ( m_pImpl->m_aProps.aTitle != pDocuSave->getName() )
{
- if ( m_pImpl->m_aProps.aTitle != pDocuSave->getName() )
+ try
{
- try
- {
- Reference< XStorage> xStorage = getContainerStorage();
-
- OUString sPersistentName = ::dbtools::createUniqueName(xStorage,"Obj");
- xStorage->copyElementTo(m_pImpl->m_aProps.sPersistentName,xStorage,sPersistentName);
-
- OUString sOldName = m_pImpl->m_aProps.aTitle;
- rename(pDocuSave->getName());
- updateDocumentTitle();
-
- uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
- {
- {PROPERTY_NAME, uno::Any(sOldName)}, // set as folder
- {PROPERTY_PERSISTENT_NAME, uno::Any(sPersistentName)},
- {PROPERTY_AS_TEMPLATE, uno::Any(m_pImpl->m_aProps.bAsTemplate)},
- }));
- Reference< XMultiServiceFactory > xORB( m_xParentContainer, UNO_QUERY_THROW );
- Reference< XInterface > xComponent( xORB->createInstanceWithArguments( SERVICE_SDB_DOCUMENTDEFINITION, aArguments ) );
- Reference< XNameContainer > xNameContainer( m_xParentContainer, UNO_QUERY_THROW );
- xNameContainer->insertByName( sOldName, makeAny( xComponent ) );
- }
- catch(const Exception&)
+ Reference< XStorage> xStorage = getContainerStorage();
+
+ OUString sPersistentName = ::dbtools::createUniqueName(xStorage,"Obj");
+ xStorage->copyElementTo(m_pImpl->m_aProps.sPersistentName,xStorage,sPersistentName);
+
+ OUString sOldName = m_pImpl->m_aProps.aTitle;
+ rename(pDocuSave->getName());
+ updateDocumentTitle();
+
+ uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
{
- DBG_UNHANDLED_EXCEPTION();
- }
+ {PROPERTY_NAME, uno::Any(sOldName)}, // set as folder
+ {PROPERTY_PERSISTENT_NAME, uno::Any(sPersistentName)},
+ {PROPERTY_AS_TEMPLATE, uno::Any(m_pImpl->m_aProps.bAsTemplate)},
+ }));
+ Reference< XMultiServiceFactory > xORB( m_xParentContainer, UNO_QUERY_THROW );
+ Reference< XInterface > xComponent( xORB->createInstanceWithArguments( SERVICE_SDB_DOCUMENTDEFINITION, aArguments ) );
+ Reference< XNameContainer > xNameContainer( m_xParentContainer, UNO_QUERY_THROW );
+ xNameContainer->insertByName( sOldName, makeAny( xComponent ) );
}
- Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
- if ( xPersist.is() )
+ catch(const Exception&)
{
- xPersist->storeOwn();
- notifyDataSourceModified();
+ DBG_UNHANDLED_EXCEPTION();
}
}
+ Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
+ if ( xPersist.is() )
+ {
+ xPersist->storeOwn();
+ notifyDataSourceModified();
+ }
}
}
-
}
catch(const Exception&)
{
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index f9dbd8421ad3..a8840427cc86 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1114,18 +1114,16 @@ TOTypeInfoSP queryPrimaryKeyType(const OTypeInfoMap& _rTypeInfo)
// because we don't have the possibility to know how to create
// such auto increment column later on
// so until we know how to do it, we create a column without autoincrement
- // if ( !aIter->second->bAutoIncrement )
- { // therefore we have searched
- if ( aIter->second->nType == DataType::INTEGER )
- {
- pTypeInfo = aIter->second; // alternative
- break;
- }
- else if ( !pTypeInfo.get() && aIter->second->nType == DataType::DOUBLE )
- pTypeInfo = aIter->second; // alternative
- else if ( !pTypeInfo.get() && aIter->second->nType == DataType::REAL )
- pTypeInfo = aIter->second; // alternative
+ // therefore we have searched
+ if ( aIter->second->nType == DataType::INTEGER )
+ {
+ pTypeInfo = aIter->second; // alternative
+ break;
}
+ else if ( !pTypeInfo.get() && aIter->second->nType == DataType::DOUBLE )
+ pTypeInfo = aIter->second; // alternative
+ else if ( !pTypeInfo.get() && aIter->second->nType == DataType::REAL )
+ pTypeInfo = aIter->second; // alternative
}
if ( !pTypeInfo.get() ) // just a fallback
pTypeInfo = queryTypeInfoByType(DataType::VARCHAR,_rTypeInfo);
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index c1612139a828..8c5775ce8691 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
@@ -606,14 +606,12 @@ bool UpdateInstallDialog::Thread::download(OUString const & sDownloadURL, Update
sTitle, css::ucb::NameClash::OVERWRITE ))
{
//the user may have cancelled the dialog because downloading took to long
- {
- SolarMutexGuard g;
- if (m_stop) {
- return m_stop;
- }
- //all errors should be handled by the command environment.
- aUpdateData.sLocalURL = destFolder + "/" + sTitle;
+ SolarMutexGuard g;
+ if (m_stop) {
+ return m_stop;
}
+ //all errors should be handled by the command environment.
+ aUpdateData.sLocalURL = destFolder + "/" + sTitle;
}
return m_stop;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index a430c4835446..d0488f7c90cb 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1195,14 +1195,11 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, sal_Int32 nInsPos,
LANGUAGE_FRENCH_SWISS,
LANGUAGE_FRENCH_LUXEMBOURG))
{
+ OUString s( cNonBreakingSpace ); // UNICODE code for no break space
+ if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s ))
{
- OUString s( cNonBreakingSpace );
- // UNICODE code for no break space
- if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s ))
- {
- if( !bSttQuote )
- ++nInsPos;
- }
+ if( !bSttQuote )
+ ++nInsPos;
}
}
}
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index d24533a63146..c107cb1a416b 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -404,67 +404,65 @@ uno::Sequence< sal_Int32 > const & OCommonEmbeddedObject::GetIntermediateStatesS
void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState )
{
- {
- ::osl::ResettableMutexGuard aGuard( m_aMutex );
- if ( m_bDisposed )
- throw lang::DisposedException(); // TODO
+ ::osl::ResettableMutexGuard aGuard( m_aMutex );
+ if ( m_bDisposed )
+ throw lang::DisposedException(); // TODO
- if ( m_nObjectState == -1 )
- throw embed::WrongStateException( "The object has no persistence!",
- static_cast< ::cppu::OWeakObject* >(this) );
+ if ( m_nObjectState == -1 )
+ throw embed::WrongStateException( "The object has no persistence!",
+ static_cast< ::cppu::OWeakObject* >(this) );
- sal_Int32 nOldState = m_nObjectState;
+ sal_Int32 nOldState = m_nObjectState;
- if ( m_nTargetState != -1 )
- {
- // means that the object is currently trying to reach the target state
- throw embed::StateChangeInProgressException( OUString(),
- uno::Reference< uno::XInterface >(),
- m_nTargetState );
- }
- else
- {
- TargetStateControl_Impl aControl( m_nTargetState, nNewState );
+ if ( m_nTargetState != -1 )
+ {
+ // means that the object is currently trying to reach the target state
+ throw embed::StateChangeInProgressException( OUString(),
+ uno::Reference< uno::XInterface >(),
+ m_nTargetState );
+ }
+ else
+ {
+ TargetStateControl_Impl aControl( m_nTargetState, nNewState );
- // in case the object is already in requested state
- if ( m_nObjectState == nNewState )
- {
- // if active object is activated again, bring its window to top
- if ( m_nObjectState == embed::EmbedStates::ACTIVE )
- m_xDocHolder->Show();
+ // in case the object is already in requested state
+ if ( m_nObjectState == nNewState )
+ {
+ // if active object is activated again, bring its window to top
+ if ( m_nObjectState == embed::EmbedStates::ACTIVE )
+ m_xDocHolder->Show();
- return;
- }
+ return;
+ }
- // retrieve sequence of states that should be passed to reach desired state
- uno::Sequence< sal_Int32 > aIntermediateStates = GetIntermediateStatesSequence_Impl( nNewState );
+ // retrieve sequence of states that should be passed to reach desired state
+ uno::Sequence< sal_Int32 > aIntermediateStates = GetIntermediateStatesSequence_Impl( nNewState );
- // notify listeners that the object is going to change the state
- StateChangeNotification_Impl( true, nOldState, nNewState,aGuard );
+ // notify listeners that the object is going to change the state
+ StateChangeNotification_Impl( true, nOldState, nNewState,aGuard );
- try {
- for ( sal_Int32 nInd = 0; nInd < aIntermediateStates.getLength(); nInd++ )
- SwitchStateTo_Impl( aIntermediateStates[nInd] );
+ try {
+ for ( sal_Int32 nInd = 0; nInd < aIntermediateStates.getLength(); nInd++ )
+ SwitchStateTo_Impl( aIntermediateStates[nInd] );
- SwitchStateTo_Impl( nNewState );
- }
- catch( const uno::Exception& )
- {
- if ( nOldState != m_nObjectState )
- // notify listeners that the object has changed the state
- StateChangeNotification_Impl( false, nOldState, m_nObjectState, aGuard );
+ SwitchStateTo_Impl( nNewState );
+ }
+ catch( const uno::Exception& )
+ {
+ if ( nOldState != m_nObjectState )
+ // notify listeners that the object has changed the state
+ StateChangeNotification_Impl( false, nOldState, m_nObjectState, aGuard );
- throw;
- }
+ throw;
}
+ }
- // notify listeners that the object has changed the state
- StateChangeNotification_Impl( false, nOldState, nNewState, aGuard );
+ // notify listeners that the object has changed the state
+ StateChangeNotification_Impl( false, nOldState, nNewState, aGuard );
- // let the object window be shown
- if ( nNewState == embed::EmbedStates::UI_ACTIVE || nNewState == embed::EmbedStates::INPLACE_ACTIVE )
- PostEvent_Impl( "OnVisAreaChanged" );
- }
+ // let the object window be shown
+ if ( nNewState == embed::EmbedStates::UI_ACTIVE || nNewState == embed::EmbedStates::INPLACE_ACTIVE )
+ PostEvent_Impl( "OnVisAreaChanged" );
}
diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx
index 71a64eedcddc..86e70007e3ac 100644
--- a/filter/source/graphicfilter/icgm/bitmap.cxx
+++ b/filter/source/graphicfilter/icgm/bitmap.cxx
@@ -131,19 +131,17 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc )
case 24 :
{
+ BitmapColor aBitmapColor;
+ for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
{
- BitmapColor aBitmapColor;
- for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
+ sal_uInt8* pTemp = rDesc.mpBuf;
+ nxC = nxCount;
+ for ( nx = 0; --nxC; nx++ )
{
- sal_uInt8* pTemp = rDesc.mpBuf;
- nxC = nxCount;
- for ( nx = 0; --nxC; nx++ )
- {
- aBitmapColor.SetRed( *pTemp++ );
- aBitmapColor.SetGreen( *pTemp++ );
- aBitmapColor.SetBlue( *pTemp++ );
- rDesc.mpAcc->SetPixel( ny, nx, aBitmapColor );
- }
+ aBitmapColor.SetRed( *pTemp++ );
+ aBitmapColor.SetGreen( *pTemp++ );
+ aBitmapColor.SetBlue( *pTemp++ );
+ rDesc.mpAcc->SetPixel( ny, nx, aBitmapColor );
}
}
}
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index dab4070a32f2..7d06983c4dbc 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1371,44 +1371,42 @@ void SVGTextWriter::implWriteBulletChars()
for( ; it != end; ++it )
{
// <g id="?" > (used by animations)
+ // As id we use the id of the text portion placeholder with prefix
+ // bullet-char-*
+ sId = "bullet-char-" + it->first;
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", sId );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "BulletChar" );
+ SvXMLElementExport aBulletCharElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, true, true );
+
+ // <g transform="translate(x,y)" >
{
- // As id we use the id of the text portion placeholder with prefix
- // bullet-char-*
- sId = "bullet-char-" + it->first;
- mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", sId );
- mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "BulletChar" );
- SvXMLElementExport aBulletCharElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, true, true );
+ const BulletListItemInfo& rInfo = it->second;
- // <g transform="translate(x,y)" >
- {
- const BulletListItemInfo& rInfo = it->second;
+ // Add positioning attribute through a translation
+ sPosition = "translate(" +
+ OUString::number( rInfo.aPos.X() ) +
+ "," + OUString::number( rInfo.aPos.Y() ) + ")";
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "transform", sPosition );
- // Add positioning attribute through a translation
- sPosition = "translate(" +
- OUString::number( rInfo.aPos.X() ) +
- "," + OUString::number( rInfo.aPos.Y() ) + ")";
- mrExport.AddAttribute( XML_NAMESPACE_NONE, "transform", sPosition );
+ mrAttributeWriter.AddPaintAttr( COL_TRANSPARENT, rInfo.aColor );
- mrAttributeWriter.AddPaintAttr( COL_TRANSPARENT, rInfo.aColor );
+ SvXMLElementExport aPositioningElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, true, true );
- SvXMLElementExport aPositioningElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, true, true );
+ // <use transform="scale(font-size)" xlink:ref="/" >
+ {
+ // Add size attribute through a scaling
+ sScaling = "scale(" + OUString::number( rInfo.nFontSize ) +
+ "," + OUString::number( rInfo.nFontSize )+ ")";
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "transform", sScaling );
- // <use transform="scale(font-size)" xlink:ref="/" >
- {
- // Add size attribute through a scaling
- sScaling = "scale(" + OUString::number( rInfo.nFontSize ) +
- "," + OUString::number( rInfo.nFontSize )+ ")";
- mrExport.AddAttribute( XML_NAMESPACE_NONE, "transform", sScaling );
-
- // Add ref attribute
- sRefId = "#bullet-char-template-" +
- OUString::number( ( rInfo.cBulletChar ) );
- mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, sRefId );
+ // Add ref attribute
+ sRefId = "#bullet-char-template-" +
+ OUString::number( ( rInfo.cBulletChar ) );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, sRefId );
- SvXMLElementExport aRefElem( mrExport, XML_NAMESPACE_NONE, "use", true, true );
- }
- } // close aPositioningElem
- } // close aBulletCharElem
+ SvXMLElementExport aRefElem( mrExport, XML_NAMESPACE_NONE, "use", true, true );
+ }
+ } // close aPositioningElem
}
// clear the map
diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx
index 6b0e75583ef9..651b6d0ed4a9 100644
--- a/framework/source/accelerators/documentacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx
@@ -101,20 +101,18 @@ DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(
const css::uno::Sequence< css::uno::Any >& lArguments)
: DocumentAcceleratorConfiguration_BASE(xContext)
{
+ SolarMutexGuard g;
+ css::uno::Reference<css::embed::XStorage> xRoot;
+ if (lArguments.getLength() == 1 && (lArguments[0] >>= xRoot))
{
- SolarMutexGuard g;
- css::uno::Reference<css::embed::XStorage> xRoot;
- if (lArguments.getLength() == 1 && (lArguments[0] >>= xRoot))
- {
- m_xDocumentRoot = xRoot;
- }
- else
- {
- ::comphelper::SequenceAsHashMap lArgs(lArguments);
- m_xDocumentRoot = lArgs.getUnpackedValueOrDefault(
- "DocumentRoot",
- css::uno::Reference< css::embed::XStorage >());
- }
+ m_xDocumentRoot = xRoot;
+ }
+ else
+ {
+ ::comphelper::SequenceAsHashMap lArgs(lArguments);
+ m_xDocumentRoot = lArgs.getUnpackedValueOrDefault(
+ "DocumentRoot",
+ css::uno::Reference< css::embed::XStorage >());
}
}
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 80ab99ba0996..d1b106592d4e 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -1127,7 +1127,7 @@ CacheLockGuard::~CacheLockGuard()
void CacheLockGuard::lock(bool bLockForAddRemoveVectorItems)
{
- /* SAFE */ {
+ /* SAFE */
osl::MutexGuard g(m_rSharedMutex);
if (m_bLockedByThisGuard)
@@ -1153,12 +1153,12 @@ void CacheLockGuard::lock(bool bLockForAddRemoveVectorItems)
++m_rCacheLock;
m_bLockedByThisGuard = true;
- } /* SAFE */
+ /* SAFE */
}
void CacheLockGuard::unlock()
{
- /* SAFE */ {
+ /* SAFE */
osl::MutexGuard g(m_rSharedMutex);
if ( ! m_bLockedByThisGuard)
@@ -1174,7 +1174,7 @@ void CacheLockGuard::unlock()
"Wrong using of member m_nDocCacheLock detected. A ref counted value shouldn't reach values <0 .-)",
m_xOwner);
}
- } /* SAFE */
+ /* SAFE */
}
DispatchParams::DispatchParams()
@@ -1659,7 +1659,7 @@ void SAL_CALL AutoRecovery::modified(const css::lang::EventObject& aEvent)
void SAL_CALL AutoRecovery::disposing(const css::lang::EventObject& aEvent)
{
- /* SAFE */ {
+ /* SAFE */
osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
if (aEvent.Source == m_xNewDocBroadcaster)
@@ -1684,7 +1684,7 @@ void SAL_CALL AutoRecovery::disposing(const css::lang::EventObject& aEvent)
return;
}
- } /* SAFE */
+ /* SAFE */
}
void AutoRecovery::implts_openConfig()
diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx
index 03e2451efbf8..cf23a75203ba 100644
--- a/package/source/zippackage/zipfileaccess.cxx
+++ b/package/source/zippackage/zipfileaccess.cxx
@@ -56,16 +56,14 @@ OZipFileAccess::OZipFileAccess( const uno::Reference< uno::XComponentContext >&
OZipFileAccess::~OZipFileAccess()
{
+ ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() );
+ if ( !m_bDisposed )
{
- ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() );
- if ( !m_bDisposed )
- {
- try {
- m_refCount++; // dispose will use refcounting so the further destruction must be avoided
- dispose();
- } catch( uno::Exception& )
- {}
- }
+ try {
+ m_refCount++; // dispose will use refcounting so the further destruction must be avoided
+ dispose();
+ } catch( uno::Exception& )
+ {}
}
}
diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx
index 8b68da19e646..0685a3da7a30 100644
--- a/reportdesign/source/core/api/ReportEngineJFree.cxx
+++ b/reportdesign/source/core/api/ReportEngineJFree.cxx
@@ -324,10 +324,8 @@ util::URL SAL_CALL OReportEngineJFree::createDocument( )
void SAL_CALL OReportEngineJFree::interrupt( )
{
- {
- ::osl::MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(ReportEngineBase::rBHelper.bDisposed);
- }
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportEngineBase::rBHelper.bDisposed);
}
uno::Reference< beans::XPropertySetInfo > SAL_CALL OReportEngineJFree::getPropertySetInfo( )
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index f2b594f8a3e6..4c62c8ec4bd5 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -1019,22 +1019,20 @@ oslFileError openFilePath(const char *cpFilePath, oslFileHandle* pHandle, sal_uI
}
}
#else /* F_SETLK */
- {
- struct flock aflock;
+ struct flock aflock;
- aflock.l_type = F_WRLCK;
- aflock.l_whence = SEEK_SET;
- aflock.l_start = 0;
- aflock.l_len = 0;
+ aflock.l_type = F_WRLCK;
+ aflock.l_whence = SEEK_SET;
+ aflock.l_start = 0;
+ aflock.l_len = 0;
- if (fcntl(fd, F_SETLK, &aflock) == -1)
- {
- int saved_errno = errno;
- SAL_INFO("sal.file", "osl_openFile(" << cpFilePath << ", " << ((flags & O_RDWR) ? "writeable":"readonly") << "): fcntl(" << fd << ", F_SETLK) failed: " << strerror(saved_errno));
- eRet = oslTranslateFileError(OSL_FET_ERROR, saved_errno);
- (void) close(fd);
- return eRet;
- }
+ if (fcntl(fd, F_SETLK, &aflock) == -1)
+ {
+ int saved_errno = errno;
+ SAL_INFO("sal.file", "osl_openFile(" << cpFilePath << ", " << ((flags & O_RDWR) ? "writeable":"readonly") << "): fcntl(" << fd << ", F_SETLK) failed: " << strerror(saved_errno));
+ eRet = oslTranslateFileError(OSL_FET_ERROR, saved_errno);
+ (void) close(fd);
+ return eRet;
}
#endif /* F_SETLK */
}
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 4e11c3108c2f..b7fc6ac2a774 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -530,40 +530,38 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode,
}
if ( bChanged )
{
- {
- // Force the chart to be loaded now, so it registers itself for UNO events.
- // UNO broadcasts are done after UpdateChartRef, so the chart will get this
- // reference change.
+ // Force the chart to be loaded now, so it registers itself for UNO events.
+ // UNO broadcasts are done after UpdateChartRef, so the chart will get this
+ // reference change.
- uno::Reference<embed::XEmbeddedObject> xIPObj =
- FindOleObjectByName(pChartListener->GetName());
+ uno::Reference<embed::XEmbeddedObject> xIPObj =
+ FindOleObjectByName(pChartListener->GetName());
- svt::EmbeddedObjectRef::TryRunningState( xIPObj );
+ svt::EmbeddedObjectRef::TryRunningState( xIPObj );
- // After the change, chart keeps track of its own data source ranges,
- // the listener doesn't need to listen anymore, except the chart has
- // an internal data provider.
- bool bInternalDataProvider = false;
- if ( xIPObj.is() )
- {
- try
- {
- uno::Reference< chart2::XChartDocument > xChartDoc( xIPObj->getComponent(), uno::UNO_QUERY_THROW );
- bInternalDataProvider = xChartDoc->hasInternalDataProvider();
- }
- catch ( uno::Exception& )
- {
- }
- }
- if ( bInternalDataProvider )
+ // After the change, chart keeps track of its own data source ranges,
+ // the listener doesn't need to listen anymore, except the chart has
+ // an internal data provider.
+ bool bInternalDataProvider = false;
+ if ( xIPObj.is() )
+ {
+ try
{
- pChartListener->ChangeListening( aNewRLR, bDataChanged );
+ uno::Reference< chart2::XChartDocument > xChartDoc( xIPObj->getComponent(), uno::UNO_QUERY_THROW );
+ bInternalDataProvider = xChartDoc->hasInternalDataProvider();
}
- else
+ catch ( uno::Exception& )
{
- pChartListener->ChangeListening( new ScRangeList, bDataChanged );
}
}
+ if ( bInternalDataProvider )
+ {
+ pChartListener->ChangeListening( aNewRLR, bDataChanged );
+ }
+ else
+ {
+ pChartListener->ChangeListening( new ScRangeList, bDataChanged );
+ }
}
}
}
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index b216b38c584e..2def729ddccb 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2334,10 +2334,8 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
//!if ( nCol1 > 0 && !aViewData.GetDocument()->IsBlockEmpty(
//! aViewData.GetTabNo(),
//! 0, nRow1, nCol1-1, nRow2 ) )
- {
- long nMarkPixel = (long)( SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
- aStart.X() -= nMarkPixel * nLayoutSign;
- }
+ long nMarkPixel = (long)( SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
+ aStart.X() -= nMarkPixel * nLayoutSign;
}
pGridWin[i]->Invalidate( pGridWin[i]->PixelToLogic( tools::Rectangle( aStart,aEnd ) ) );
diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index 1096019a2ccc..30653a9a02f9 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1277,10 +1277,8 @@ void AnimationExporter::exportAnimEvent( SvStream& rStrm, const Reference< XAnim
Reference< XEnumeration > xE( xEA->createEnumeration(), UNO_QUERY_THROW );
if ( xE.is() && xE->hasMoreElements() )
{
- {
- Reference< XAnimationNode > xClickNode( xE->nextElement(), UNO_QUERY );
- aAny = xClickNode->getBegin();
- }
+ Reference< XAnimationNode > xClickNode( xE->nextElement(), UNO_QUERY );
+ aAny = xClickNode->getBegin();
}
}
else if ( nFlags & 0x40 )
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 6e4fd747d427..48b01a169b38 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1832,35 +1832,33 @@ void CustomAnimationPane::onAdd()
if( pDescriptor.get() )
{
+ mpCustomAnimationList->SelectAll( false );
+
+ // gather shapes from the selection
+ std::vector< Any >::iterator aIter( aTargets.begin() );
+ const std::vector< Any >::iterator aEnd( aTargets.end() );
+ bool bFirst = true;
+ for( ; aIter != aEnd; ++aIter )
{
- mpCustomAnimationList->SelectAll( false );
+ CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration );
- // gather shapes from the selection
- std::vector< Any >::iterator aIter( aTargets.begin() );
- const std::vector< Any >::iterator aEnd( aTargets.end() );
- bool bFirst = true;
- for( ; aIter != aEnd; ++aIter )
+ // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs
+ if( bHasText && (aTargets.size() == 1) )
{
- CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration );
-
- // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs
- if( bHasText && (aTargets.size() == 1) )
+ Reference< XShape > xShape( (*aIter), UNO_QUERY );
+ if( xShape.is() && !hasVisibleShape( xShape ) )
{
- Reference< XShape > xShape( (*aIter), UNO_QUERY );
- if( xShape.is() && !hasVisibleShape( xShape ) )
- {
- mpMainSequence->createTextGroup( pCreated, 1, -1.0, false, false );
- }
+ mpMainSequence->createTextGroup( pCreated, 1, -1.0, false, false );
}
+ }
- if( bFirst )
- bFirst = false;
- else
- pCreated->setNodeType( EffectNodeType::WITH_PREVIOUS );
+ if( bFirst )
+ bFirst = false;
+ else
+ pCreated->setNodeType( EffectNodeType::WITH_PREVIOUS );
- if( pCreated.get() )
- mpCustomAnimationList->select( pCreated );
- }
+ if( pCreated.get() )
+ mpCustomAnimationList->select( pCreated );
}
}
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index cc129aa487f3..90d75e5871f3 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2704,82 +2704,80 @@ void SAL_CALL SdXImpressDocument::dispose()
{
if( !mbDisposed )
{
- {
- ::SolarMutexGuard aGuard;
+ ::SolarMutexGuard aGuard;
- if( mpDoc )
- {
- EndListening( *mpDoc );
- mpDoc = nullptr;
- }
-
- // Call the base class dispose() before setting the mbDisposed flag
- // to true. The reason for this is that if close() has not yet been
- // called this is done in SfxBaseModel::dispose(). At the end of
- // that dispose() is called again. It is important to forward this
- // second dispose() to the base class, too.
- // As a consequence the following code has to be able to be run twice.
- SfxBaseModel::dispose();
- mbDisposed = true;
-
- uno::Reference< container::XNameAccess > xLinks( mxLinks );
- if( xLinks.is() )
- {
- uno::Reference< lang::XComponent > xComp( xLinks, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ if( mpDoc )
+ {
+ EndListening( *mpDoc );
+ mpDoc = nullptr;
+ }
- xLinks = nullptr;
- }
+ // Call the base class dispose() before setting the mbDisposed flag
+ // to true. The reason for this is that if close() has not yet been
+ // called this is done in SfxBaseModel::dispose(). At the end of
+ // that dispose() is called again. It is important to forward this
+ // second dispose() to the base class, too.
+ // As a consequence the following code has to be able to be run twice.
+ SfxBaseModel::dispose();
+ mbDisposed = true;
+
+ uno::Reference< container::XNameAccess > xLinks( mxLinks );
+ if( xLinks.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xLinks, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- uno::Reference< drawing::XDrawPages > xDrawPagesAccess( mxDrawPagesAccess );
- if( xDrawPagesAccess.is() )
- {
- uno::Reference< lang::XComponent > xComp( xDrawPagesAccess, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ xLinks = nullptr;
+ }
- xDrawPagesAccess = nullptr;
- }
+ uno::Reference< drawing::XDrawPages > xDrawPagesAccess( mxDrawPagesAccess );
+ if( xDrawPagesAccess.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xDrawPagesAccess, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- uno::Reference< drawing::XDrawPages > xMasterPagesAccess( mxMasterPagesAccess );
- if( xDrawPagesAccess.is() )
- {
- uno::Reference< lang::XComponent > xComp( xMasterPagesAccess, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ xDrawPagesAccess = nullptr;
+ }
- xDrawPagesAccess = nullptr;
- }
+ uno::Reference< drawing::XDrawPages > xMasterPagesAccess( mxMasterPagesAccess );
+ if( xDrawPagesAccess.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xMasterPagesAccess, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- uno::Reference< container::XNameAccess > xLayerManager( mxLayerManager );
- if( xLayerManager.is() )
- {
- uno::Reference< lang::XComponent > xComp( xLayerManager, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ xDrawPagesAccess = nullptr;
+ }
- xLayerManager = nullptr;
- }
+ uno::Reference< container::XNameAccess > xLayerManager( mxLayerManager );
+ if( xLayerManager.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xLayerManager, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- uno::Reference< container::XNameContainer > xCustomPresentationAccess( mxCustomPresentationAccess );
- if( xCustomPresentationAccess.is() )
- {
- uno::Reference< lang::XComponent > xComp( xCustomPresentationAccess, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ xLayerManager = nullptr;
+ }
- xCustomPresentationAccess = nullptr;
- }
+ uno::Reference< container::XNameContainer > xCustomPresentationAccess( mxCustomPresentationAccess );
+ if( xCustomPresentationAccess.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xCustomPresentationAccess, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- mxDashTable = nullptr;
- mxGradientTable = nullptr;
- mxHatchTable = nullptr;
- mxBitmapTable = nullptr;
- mxTransGradientTable = nullptr;
- mxMarkerTable = nullptr;
- mxDrawingPool = nullptr;
+ xCustomPresentationAccess = nullptr;
}
+
+ mxDashTable = nullptr;
+ mxGradientTable = nullptr;
+ mxHatchTable = nullptr;
+ mxBitmapTable = nullptr;
+ mxTransGradientTable = nullptr;
+ mxMarkerTable = nullptr;
+ mxDrawingPool = nullptr;
}
}
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index cc06ba7550e0..d0695acdd481 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -217,12 +217,10 @@ SfxHelp::SfxHelp() :
{
// read the environment variable "HELP_DEBUG"
// if it's set, you will see debug output on active help
- {
- OUString sHelpDebug;
- OUString sEnvVarName( "HELP_DEBUG" );
- osl_getEnvironment( sEnvVarName.pData, &sHelpDebug.pData );
- bIsDebug = !sHelpDebug.isEmpty();
- }
+ OUString sHelpDebug;
+ OUString sEnvVarName( "HELP_DEBUG" );
+ osl_getEnvironment( sEnvVarName.pData, &sHelpDebug.pData );
+ bIsDebug = !sHelpDebug.isEmpty();
}
SfxHelp::~SfxHelp()
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index c6539ea99001..a2bc394cacec 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -258,12 +258,10 @@ void SfxProgress::SetState
const SfxBoolItem* pHiddenItem = SfxItemSet::GetItem<SfxBoolItem>(pMedium->GetItemSet(), SID_HIDDEN, false);
if ( !pHiddenItem || !pHiddenItem->GetValue() )
{
- {
- const SfxUnoAnyItem* pIndicatorItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pMedium->GetItemSet(), SID_PROGRESS_STATUSBAR_CONTROL, false);
- Reference< XStatusIndicator > xInd;
- if ( pIndicatorItem && (pIndicatorItem->GetValue()>>=xInd) )
- pImpl->xStatusInd = xInd;
- }
+ const SfxUnoAnyItem* pIndicatorItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pMedium->GetItemSet(), SID_PROGRESS_STATUSBAR_CONTROL, false);
+ Reference< XStatusIndicator > xInd;
+ if ( pIndicatorItem && (pIndicatorItem->GetValue()>>=xInd) )
+ pImpl->xStatusInd = xInd;
}
}
}
diff --git a/solenv/CompilerTest_compilerplugins_clang.mk b/solenv/CompilerTest_compilerplugins_clang.mk
index e622c9ae1ae3..0a1fc0f2ebfe 100644
--- a/solenv/CompilerTest_compilerplugins_clang.mk
+++ b/solenv/CompilerTest_compilerplugins_clang.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_CompilerTest_CompilerTest,compilerplugins_clang))
$(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
compilerplugins/clang/test/badstatics \
+ compilerplugins/clang/test/blockblock \
compilerplugins/clang/test/casttovoid \
compilerplugins/clang/test/constparams \
$(if $(filter-out INTEL,$(CPU)),compilerplugins/clang/test/convertuintptr) \
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 705405fe8c25..a4bfba7d192e 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -116,15 +116,13 @@ FSStorage::FSStorage( const ::ucbhelper::Content& aContent,
FSStorage::~FSStorage()
{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- m_refCount++; // to call dispose
- try {
- dispose();
- }
- catch( uno::RuntimeException& )
- {}
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_refCount++; // to call dispose
+ try {
+ dispose();
}
+ catch( uno::RuntimeException& )
+ {}
}
bool FSStorage::MakeFolderNoUI( const OUString& rFolder )
diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx
index 50ac24a8f427..53d30bf07ed2 100644
--- a/svtools/source/uno/unocontroltablemodel.cxx
+++ b/svtools/source/uno/unocontroltablemodel.cxx
@@ -496,11 +496,9 @@ namespace svt { namespace table
// not (yet?) know about it.
// So, handle it gracefully.
#if OSL_DEBUG_LEVEL > 0
- {
- Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
- OSL_ENSURE( xColumnModel.is() && i_col < xColumnModel->getColumnCount(),
- "UnoControlTableModel::getCellContent: request a column's value which the ColumnModel doesn't know about!" );
- }
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ OSL_ENSURE( xColumnModel.is() && i_col < xColumnModel->getColumnCount(),
+ "UnoControlTableModel::getCellContent: request a column's value which the ColumnModel doesn't know about!" );
#endif
}
else
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index e48d24b50dbc..ba05aa98b0db 100644
--- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
@@ -387,16 +387,12 @@ void SAL_CALL SvxPixelCtlAccessible::disposing()
{
if( !rBHelper.bDisposed )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( mnClientId )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( mnClientId )
- {
- comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this );
- mnClientId = 0;
- }
+ comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this );
+ mnClientId = 0;
}
- //mxParent.clear();
-
}
}
diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index 333907a5b35a..6464b9879b99 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -185,11 +185,9 @@ OParseContextClient::OParseContextClient()
OParseContextClient::~OParseContextClient()
{
- {
- ::osl::MutexGuard aGuard( getSafteyMutex() );
- if ( 0 == osl_atomic_decrement( &getCounter() ) )
- delete getSharedContext(nullptr,true);
- }
+ ::osl::MutexGuard aGuard( getSafteyMutex() );
+ if ( 0 == osl_atomic_decrement( &getCounter() ) )
+ delete getSharedContext(nullptr,true);
}
const OSystemParseContext* OParseContextClient::getParseContext() const
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index d4d995064424..7c9f54e35bd8 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -430,14 +430,12 @@ const tools::Rectangle& SdrVirtObj::GetSnapRect() const
void SdrVirtObj::SetSnapRect(const tools::Rectangle& rRect)
{
- {
- tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
- tools::Rectangle aR(rRect);
- aR-=aAnchor;
- rRefObj.SetSnapRect(aR);
- SetRectsDirty();
- SendUserCall(SdrUserCallType::Resize,aBoundRect0);
- }
+ tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
+ tools::Rectangle aR(rRect);
+ aR-=aAnchor;
+ rRefObj.SetSnapRect(aR);
+ SetRectsDirty();
+ SendUserCall(SdrUserCallType::Resize,aBoundRect0);
}
void SdrVirtObj::NbcSetSnapRect(const tools::Rectangle& rRect)
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx
index c54947739ddb..1c220bea373a 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -214,21 +214,13 @@ void DocumentLayoutManager::DelLayoutFormat( SwFrameFormat *pFormat )
SwOLENode* pOLENd = m_rDoc.GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
if( pOLENd && pOLENd->GetOLEObj().IsOleRef() )
{
-
- // TODO: the old object closed the object and cleared all references to it, but didn't remove it from the container.
- // I have no idea, why, nobody could explain it - so I do my very best to mimic this behavior
- //uno::Reference < util::XCloseable > xClose( pOLENd->GetOLEObj().GetOleRef(), uno::UNO_QUERY );
- //if ( xClose.is() )
+ try
+ {
+ pOLENd->GetOLEObj().GetOleRef()->changeState( embed::EmbedStates::LOADED );
+ }
+ catch ( uno::Exception& )
{
- try
- {
- pOLENd->GetOLEObj().GetOleRef()->changeState( embed::EmbedStates::LOADED );
- }
- catch ( uno::Exception& )
- {
- }
}
-
}
}
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 685555675402..aca6ee9efdb2 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1634,9 +1634,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
}
if( aSet.Count() )
{
- {
- pNewFormat->SetFormatAttr( aSet );
- }
+ pNewFormat->SetFormatAttr( aSet );
}
return pNewFormat;
}
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index b03fd33f4f49..f0eecddda7cc 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -4409,19 +4409,17 @@ SwFrameFormat* SwShareBoxFormats::GetFormat( const SwFrameFormat& rFormat,
void SwShareBoxFormats::AddFormat( const SwFrameFormat& rOld, SwFrameFormat& rNew )
{
+ sal_uInt16 nPos;
+ SwShareBoxFormat* pEntry;
+ if( !Seek_Entry( rOld, &nPos ))
{
- sal_uInt16 nPos;
- SwShareBoxFormat* pEntry;
- if( !Seek_Entry( rOld, &nPos ))
- {
- pEntry = new SwShareBoxFormat( rOld );
- m_ShareArr.insert(m_ShareArr.begin() + nPos, std::unique_ptr<SwShareBoxFormat>(pEntry));
- }
- else
- pEntry = m_ShareArr[ nPos ].get();
-
- pEntry->AddFormat( rNew );
+ pEntry = new SwShareBoxFormat( rOld );
+ m_ShareArr.insert(m_ShareArr.begin() + nPos, std::unique_ptr<SwShareBoxFormat>(pEntry));
}
+ else
+ pEntry = m_ShareArr[ nPos ].get();
+
+ pEntry->AddFormat( rNew );
}
void SwShareBoxFormats::ChangeFrameFormat( SwTableBox* pBox, SwTableLine* pLn,
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index d77518100c33..1cb60f6e6572 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2053,22 +2053,20 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
SwContentNode* pNextNd = GetNodes()[ nNextNd ]->GetContentNode();
if( pNextNd )
{
+ SwFrameFormat* pTableFormat = pTableNd->GetTable().GetFrameFormat();
+ const SfxPoolItem *pItem;
+ if( SfxItemState::SET == pTableFormat->GetItemState( RES_PAGEDESC,
+ false, &pItem ) )
{
- SwFrameFormat* pTableFormat = pTableNd->GetTable().GetFrameFormat();
- const SfxPoolItem *pItem;
- if( SfxItemState::SET == pTableFormat->GetItemState( RES_PAGEDESC,
- false, &pItem ) )
- {
- pNextNd->SetAttr( *pItem );
- bSavePageDesc = true;
- }
+ pNextNd->SetAttr( *pItem );
+ bSavePageDesc = true;
+ }
- if( SfxItemState::SET == pTableFormat->GetItemState( RES_BREAK,
- false, &pItem ) )
- {
- pNextNd->SetAttr( *pItem );
- bSavePageBreak = true;
- }
+ if( SfxItemState::SET == pTableFormat->GetItemState( RES_BREAK,
+ false, &pItem ) )
+ {
+ pNextNd->SetAttr( *pItem );
+ bSavePageBreak = true;
}
}
SwUndoDelete* pUndo = new SwUndoDelete( aPaM );
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 094201d7c5c3..f5ab64dc57f0 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1593,39 +1593,37 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
SwTextNode* const pEndSrcNd = aEndIdx.GetNode().GetTextNode();
if ( pEndSrcNd )
{
+ // at the end of this range a new TextNode will be created
+ if( !bSplitDestNd )
{
- // at the end of this range a new TextNode will be created
- if( !bSplitDestNd )
- {
- if( rPos.nNode < rNodes.GetEndOfContent().GetIndex() )
- {
- ++rPos.nNode;
- }
-
- pDestNd =
- rNodes.MakeTextNode( rPos.nNode, pEndSrcNd->GetTextColl() );
- --rPos.nNode;
- rPos.nContent.Assign( pDestNd, 0 );
- }
- else
+ if( rPos.nNode < rNodes.GetEndOfContent().GetIndex() )
{
- pDestNd = rPos.nNode.GetNode().GetTextNode();
+ ++rPos.nNode;
}
- if (pDestNd && pEnd->nContent.GetIndex())
- {
- // move the content into the new node
- SwIndex aIdx( pEndSrcNd, 0 );
- pEndSrcNd->CutText( pDestNd, rPos.nContent, aIdx,
- pEnd->nContent.GetIndex());
- }
+ pDestNd =
+ rNodes.MakeTextNode( rPos.nNode, pEndSrcNd->GetTextColl() );
+ --rPos.nNode;
+ rPos.nContent.Assign( pDestNd, 0 );
+ }
+ else
+ {
+ pDestNd = rPos.nNode.GetNode().GetTextNode();
+ }
- if (pDestNd && bCopyCollFormat)
- {
- SwDoc* const pInsDoc = pDestNd->GetDoc();
- ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
- pEndSrcNd->CopyCollFormat( *pDestNd );
- }
+ if (pDestNd && pEnd->nContent.GetIndex())
+ {
+ // move the content into the new node
+ SwIndex aIdx( pEndSrcNd, 0 );
+ pEndSrcNd->CutText( pDestNd, rPos.nContent, aIdx,
+ pEnd->nContent.GetIndex());
+ }
+
+ if (pDestNd && bCopyCollFormat)
+ {
+ SwDoc* const pInsDoc = pDestNd->GetDoc();
+ ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
+ pEndSrcNd->CopyCollFormat( *pDestNd );
}
}
else
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 968b30059d6f..39bd373e490c 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -221,20 +221,18 @@ static void lcl_SetSpecialProperty(SwFrameFormat* pFormat,
case FN_TABLE_HEADLINE_REPEAT:
case FN_TABLE_HEADLINE_COUNT:
{
+ SwTable* pTable = SwTable::FindTable( pFormat );
+ UnoActionContext aAction(pFormat->GetDoc());
+ if( pEntry->nWID == FN_TABLE_HEADLINE_REPEAT)
{
- SwTable* pTable = SwTable::FindTable( pFormat );
- UnoActionContext aAction(pFormat->GetDoc());
- if( pEntry->nWID == FN_TABLE_HEADLINE_REPEAT)
- {
- pFormat->GetDoc()->SetRowsToRepeat( *pTable, aValue.get<bool>() ? 1 : 0 );
- }
- else
- {
- sal_Int32 nRepeat = 0;
- aValue >>= nRepeat;
- if( nRepeat >= 0 && nRepeat < USHRT_MAX )
- pFormat->GetDoc()->SetRowsToRepeat( *pTable, (sal_uInt16) nRepeat );
- }
+ pFormat->GetDoc()->SetRowsToRepeat( *pTable, aValue.get<bool>() ? 1 : 0 );
+ }
+ else
+ {
+ sal_Int32 nRepeat = 0;
+ aValue >>= nRepeat;
+ if( nRepeat >= 0 && nRepeat < USHRT_MAX )
+ pFormat->GetDoc()->SetRowsToRepeat( *pTable, (sal_uInt16) nRepeat );
}
}
break;
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index 07e15faad4f6..3e9016dabc70 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -111,13 +111,10 @@ static void lcl_addAspect(
const XMLPropertyState **pStates,
const rtl::Reference < XMLPropertySetMapper >& rMapper )
{
+ sal_Int64 nAspect = rObj.GetViewAspect();
+ if ( nAspect )
{
- sal_Int64 nAspect = rObj.GetViewAspect();
-
- if ( nAspect )
- {
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_DRAW_ASPECT ), uno::makeAny( nAspect ) );
- }
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_DRAW_ASPECT ), uno::makeAny( nAspect ) );
}
}
@@ -126,23 +123,21 @@ static void lcl_addOutplaceProperties(
const XMLPropertyState **pStates,
const rtl::Reference < XMLPropertySetMapper >& rMapper )
{
- {
- MapMode aMode( MapUnit::Map100thMM ); // the API expects this map mode for the embedded objects
- Size aSize = rObj.GetSize( &aMode ); // get the size in the requested map mode
+ MapMode aMode( MapUnit::Map100thMM ); // the API expects this map mode for the embedded objects
+ Size aSize = rObj.GetSize( &aMode ); // get the size in the requested map mode
- if( aSize.Width() && aSize.Height() )
- {
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_LEFT ), Any(sal_Int32(0)) );
- pStates++;
+ if( aSize.Width() && aSize.Height() )
+ {
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_LEFT ), Any(sal_Int32(0)) );
+ pStates++;
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_TOP ), Any(sal_Int32(0)) );
- pStates++;
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_TOP ), Any(sal_Int32(0)) );
+ pStates++;
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_WIDTH ), Any((sal_Int32)aSize.Width()) );
- pStates++;
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_WIDTH ), Any((sal_Int32)aSize.Width()) );
+ pStates++;
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), Any((sal_Int32)aSize.Height()) );
- }
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), Any((sal_Int32)aSize.Height()) );
}
}
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index edec1e0412ba..e36595431cee 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1418,26 +1418,24 @@ sal_Int32 SwFramePage::FillPosLB(const FrameMap* _pMap,
for (size_t i = 0; _pMap && i < nCount; ++i)
{
// Why not from the left/from inside or from above?
+ SvxSwFramePosString::StringId eStrId = m_pMirrorPagesCB->IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
+ // --> OD 2009-08-31 #mongolianlayout#
+ eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId,
+ m_bIsVerticalFrame,
+ m_bIsVerticalL2R,
+ m_bIsInRightToLeft);
+ OUString sEntry(SvxSwFramePosString::GetString(eStrId));
+ if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
{
- SvxSwFramePosString::StringId eStrId = m_pMirrorPagesCB->IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
- // --> OD 2009-08-31 #mongolianlayout#
- eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId,
- m_bIsVerticalFrame,
- m_bIsVerticalL2R,
- m_bIsInRightToLeft);
- OUString sEntry(SvxSwFramePosString::GetString(eStrId));
- if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
- {
- // don't insert entries when frames are character bound
- _rLB.InsertEntry(sEntry);
- }
- // i#22341 - add condition to handle map <aVCharMap>
- // that is ambiguous in the alignment.
- if ( _pMap[i].nAlign == _nAlign &&
- ( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
- {
- sSelEntry = sEntry;
- }
+ // don't insert entries when frames are character bound
+ _rLB.InsertEntry(sEntry);
+ }
+ // i#22341 - add condition to handle map <aVCharMap>
+ // that is ambiguous in the alignment.
+ if ( _pMap[i].nAlign == _nAlign &&
+ ( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
+ {
+ sSelEntry = sEntry;
}
}
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 7e45823ddd29..2811c217580c 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -571,32 +571,30 @@ void SwDBManager::ImportFromConnection( SwWrtShell* pSh )
{
if(pImpl->pMergeData && !pImpl->pMergeData->bEndOfDB)
{
- {
- pSh->StartAllAction();
- pSh->StartUndo();
- bool bGroupUndo(pSh->DoesGroupUndo());
- pSh->DoGroupUndo(false);
-
- if( pSh->HasSelection() )
- pSh->DelRight();
+ pSh->StartAllAction();
+ pSh->StartUndo();
+ bool bGroupUndo(pSh->DoesGroupUndo());
+ pSh->DoGroupUndo(false);
- std::unique_ptr<SwWait> pWait;
+ if( pSh->HasSelection() )
+ pSh->DelRight();
- {
- sal_uLong i = 0;
- do {
+ std::unique_ptr<SwWait> pWait;
- ImportDBEntry(pSh);
- if( 10 == ++i )
- pWait.reset(new SwWait( *pSh->GetView().GetDocShell(), true));
+ {
+ sal_uLong i = 0;
+ do {
- } while(ToNextMergeRecord());
- }
+ ImportDBEntry(pSh);
+ if( 10 == ++i )
+ pWait.reset(new SwWait( *pSh->GetView().GetDocShell(), true));
- pSh->DoGroupUndo(bGroupUndo);
- pSh->EndUndo();
- pSh->EndAllAction();
+ } while(ToNextMergeRecord());
}
+
+ pSh->DoGroupUndo(bGroupUndo);
+ pSh->EndUndo();
+ pSh->EndAllAction();
}
}
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 07c467b126fe..b7aa96bb086a 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5809,11 +5809,10 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
if ( !bOverSelect )
{
- { // create only temporary move context because otherwise
- // the query against the content form doesn't work!!!
- SwMvContext aMvContext( &rSh );
- rSh.CallSetCursor(&aDocPos, false);
- }
+ // create only temporary move context because otherwise
+ // the query against the content form doesn't work!!!
+ SwMvContext aMvContext( &rSh );
+ rSh.CallSetCursor(&aDocPos, false);
}
if( !bOverURLGrf )
{
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index ab61baa6bc4c..671906587815 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1815,19 +1815,17 @@ void SwTextShell::GetState( SfxItemSet &rSet )
break;
case FN_NUM_CONTINUE:
{
+ // #i86492#
+ // Search also for bullet list
+ OUString aDummy;
+ const SwNumRule* pRule =
+ rSh.SearchNumRule( true, aDummy );
+ if ( !pRule )
{
- // #i86492#
- // Search also for bullet list
- OUString aDummy;
- const SwNumRule* pRule =
- rSh.SearchNumRule( true, aDummy );
- if ( !pRule )
- {
- pRule = rSh.SearchNumRule( false, aDummy );
- }
- if ( !pRule )
- rSet.DisableItem(nWhich);
+ pRule = rSh.SearchNumRule( false, aDummy );
}
+ if ( !pRule )
+ rSet.DisableItem(nWhich);
}
break;
case SID_INSERT_RLM :
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index 231902eeb2b2..0d1f1be27d15 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -536,15 +536,13 @@ void SwWrtShell::EnterStdMode()
// SwActContext opens and action which has to be
// closed prior to the call of
// GetChgLnk().Call()
- {
- SwActContext aActContext(this);
- m_bSelWrd = m_bSelLn = false;
- if( !IsRetainSelection() )
- KillPams();
- ClearMark();
- m_fnSetCursor = &SwWrtShell::SetCursorKillSel;
- m_fnKillSel = &SwWrtShell::ResetSelect;
- }
+ SwActContext aActContext(this);
+ m_bSelWrd = m_bSelLn = false;
+ if( !IsRetainSelection() )
+ KillPams();
+ ClearMark();
+ m_fnSetCursor = &SwWrtShell::SetCursorKillSel;
+ m_fnKillSel = &SwWrtShell::ResetSelect;
}
Invalidate();
SwTransferable::ClearSelection( *this );
diff --git a/tools/qa/cppunit/test_color.cxx b/tools/qa/cppunit/test_color.cxx
index d0f0e173f9a7..dc89226fb3f7 100644
--- a/tools/qa/cppunit/test_color.cxx
+++ b/tools/qa/cppunit/test_color.cxx
@@ -61,21 +61,19 @@ void Test::test_asRGBColor()
void Test::test_readAndWriteStream()
{
- {
- SvMemoryStream aStream;
- Color aWriteColor(0x12, 0x34, 0x56);
- Color aReadColor;
+ SvMemoryStream aStream;
+ Color aWriteColor(0x12, 0x34, 0x56);
+ Color aReadColor;
- WriteColor(aStream, aWriteColor);
+ WriteColor(aStream, aWriteColor);
- aStream.Seek(STREAM_SEEK_TO_BEGIN);
+ aStream.Seek(STREAM_SEEK_TO_BEGIN);
- ReadColor(aStream, aReadColor);
+ ReadColor(aStream, aReadColor);
- CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x12), aReadColor.GetRed());
- CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x34), aReadColor.GetGreen());
- CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x56), aReadColor.GetBlue());
- }
+ CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x12), aReadColor.GetRed());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x34), aReadColor.GetGreen());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x56), aReadColor.GetBlue());
}
OUString createTintShade(sal_uInt8 nR, sal_uInt8 nG, sal_uInt8 nB, OUString const & sReference, sal_Int16 nTintShade)
diff --git a/tools/qa/cppunit/test_inetmime.cxx b/tools/qa/cppunit/test_inetmime.cxx
index c28fa6885f99..61c5d45fa774 100644
--- a/tools/qa/cppunit/test_inetmime.cxx
+++ b/tools/qa/cppunit/test_inetmime.cxx
@@ -60,112 +60,108 @@ namespace
void Test::test_scanContentType_basic()
{
- {
- OUString input
- = "TEST/subTST; parm1=Value1; Parm2=\"unpacked value; %20\"";
- // Just scan input for valid string:
- auto end = INetMIME::scanContentType(input);
- CPPUNIT_ASSERT(end != nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
- // Scan input and parse type, subType and parameters:
- OUString type;
- OUString subType;
- INetContentTypeParameterList parameters;
- end = INetMIME::scanContentType(input,
- &type, &subType, &parameters);
- CPPUNIT_ASSERT(end != nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
- CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
- CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
- CPPUNIT_ASSERT_EQUAL(
- INetContentTypeParameterList::size_type(2), parameters.size());
- auto i = parameters.find("parm1");
- CPPUNIT_ASSERT(i != parameters.end());
- CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sCharset);
- CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sLanguage);
- CPPUNIT_ASSERT_EQUAL(OUString("Value1"), i->second.m_sValue);
- CPPUNIT_ASSERT(i->second.m_bConverted);
- i = parameters.find("parm2");
- CPPUNIT_ASSERT(i != parameters.end());
- CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sCharset);
- CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sLanguage);
- CPPUNIT_ASSERT_EQUAL(OUString("unpacked value; %20"), i->second.m_sValue);
- CPPUNIT_ASSERT(i->second.m_bConverted);
- }
+ OUString input
+ = "TEST/subTST; parm1=Value1; Parm2=\"unpacked value; %20\"";
+ // Just scan input for valid string:
+ auto end = INetMIME::scanContentType(input);
+ CPPUNIT_ASSERT(end != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
+ // Scan input and parse type, subType and parameters:
+ OUString type;
+ OUString subType;
+ INetContentTypeParameterList parameters;
+ end = INetMIME::scanContentType(input,
+ &type, &subType, &parameters);
+ CPPUNIT_ASSERT(end != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
+ CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
+ CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
+ CPPUNIT_ASSERT_EQUAL(
+ INetContentTypeParameterList::size_type(2), parameters.size());
+ auto i = parameters.find("parm1");
+ CPPUNIT_ASSERT(i != parameters.end());
+ CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sCharset);
+ CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sLanguage);
+ CPPUNIT_ASSERT_EQUAL(OUString("Value1"), i->second.m_sValue);
+ CPPUNIT_ASSERT(i->second.m_bConverted);
+ i = parameters.find("parm2");
+ CPPUNIT_ASSERT(i != parameters.end());
+ CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sCharset);
+ CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sLanguage);
+ CPPUNIT_ASSERT_EQUAL(OUString("unpacked value; %20"), i->second.m_sValue);
+ CPPUNIT_ASSERT(i->second.m_bConverted);
}
void Test::test_scanContentType_rfc2231()
{
- {
- // Test extended parameter with value split in 3 sections:
- OUString input
- = "TEST/subTST; "
- "parm1*0*=US-ASCII'En'5%25%20; "
- "Parm1*1*=of%2010;\t"
- "parm1*2*=%20%3d%200.5";
- // Just scan input for valid string:
- auto end = INetMIME::scanContentType(input);
- CPPUNIT_ASSERT(end != nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
- // Scan input and parse type, subType and parameters:
- OUString type;
- OUString subType;
- INetContentTypeParameterList parameters;
- end = INetMIME::scanContentType(input,
- &type, &subType, &parameters);
- CPPUNIT_ASSERT(end != nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
- CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
- CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
- CPPUNIT_ASSERT_EQUAL(
- INetContentTypeParameterList::size_type(1), parameters.size());
- auto i = parameters.find("parm1");
- CPPUNIT_ASSERT(i != parameters.end());
- CPPUNIT_ASSERT_EQUAL(OString("us-ascii"), i->second.m_sCharset);
- CPPUNIT_ASSERT_EQUAL(OString("en"), i->second.m_sLanguage);
- CPPUNIT_ASSERT_EQUAL(OUString("5% of 10 = 0.5"), i->second.m_sValue);
- CPPUNIT_ASSERT(i->second.m_bConverted);
+ // Test extended parameter with value split in 3 sections:
+ OUString input
+ = "TEST/subTST; "
+ "parm1*0*=US-ASCII'En'5%25%20; "
+ "Parm1*1*=of%2010;\t"
+ "parm1*2*=%20%3d%200.5";
+ // Just scan input for valid string:
+ auto end = INetMIME::scanContentType(input);
+ CPPUNIT_ASSERT(end != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
+ // Scan input and parse type, subType and parameters:
+ OUString type;
+ OUString subType;
+ INetContentTypeParameterList parameters;
+ end = INetMIME::scanContentType(input,
+ &type, &subType, &parameters);
+ CPPUNIT_ASSERT(end != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
+ CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
+ CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
+ CPPUNIT_ASSERT_EQUAL(
+ INetContentTypeParameterList::size_type(1), parameters.size());
+ auto i = parameters.find("parm1");
+ CPPUNIT_ASSERT(i != parameters.end());
+ CPPUNIT_ASSERT_EQUAL(OString("us-ascii"), i->second.m_sCharset);
+ CPPUNIT_ASSERT_EQUAL(OString("en"), i->second.m_sLanguage);
+ CPPUNIT_ASSERT_EQUAL(OUString("5% of 10 = 0.5"), i->second.m_sValue);
+ CPPUNIT_ASSERT(i->second.m_bConverted);
- // Test extended parameters with different value charsets:
- input = "TEST/subTST;"
- "parm1*0*=us-ascii'en'value;PARM1*1*=1;"
- "parm2*0*=WINDOWS-1250'en-GB'value2%20%80;"
- "parm3*0*=UNKNOWN'EN'value3;"
- "parm1*1*=2"; // this parameter is a duplicate,
- // the scan should end before this parameter
- // Just scan input for valid string:
- end = INetMIME::scanContentType(input);
- CPPUNIT_ASSERT(end != nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString(";parm1*1*=2"), OUString(end)); // the invalid end of input
- // Scan input and parse type, subType and parameters:
- end = INetMIME::scanContentType(input,
- &type, &subType, &parameters);
- CPPUNIT_ASSERT(end != nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString(";parm1*1*=2"), OUString(end)); // the invalid end of input
- CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
- CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
- CPPUNIT_ASSERT_EQUAL(
- INetContentTypeParameterList::size_type(3), parameters.size());
- i = parameters.find("parm1");
- CPPUNIT_ASSERT(i != parameters.end());
- CPPUNIT_ASSERT_EQUAL(OString("us-ascii"), i->second.m_sCharset);
- CPPUNIT_ASSERT_EQUAL(OString("en"), i->second.m_sLanguage);
- CPPUNIT_ASSERT_EQUAL(OUString("value1"), i->second.m_sValue);
- CPPUNIT_ASSERT(i->second.m_bConverted);
- i = parameters.find("parm2");
- CPPUNIT_ASSERT(i != parameters.end());
- CPPUNIT_ASSERT_EQUAL(OString("windows-1250"), i->second.m_sCharset);
- CPPUNIT_ASSERT_EQUAL(OString("en-gb"), i->second.m_sLanguage);
- // Euro currency sign, windows-1250 x80 is converted to unicode u20AC:
- CPPUNIT_ASSERT_EQUAL(OUString(u"value2 \u20AC"), i->second.m_sValue);
- CPPUNIT_ASSERT(i->second.m_bConverted);
- i = parameters.find("parm3");
- CPPUNIT_ASSERT(i != parameters.end());
- CPPUNIT_ASSERT_EQUAL(OString("unknown"), i->second.m_sCharset);
- CPPUNIT_ASSERT_EQUAL(OString("en"), i->second.m_sLanguage);
- // Conversion fails for unknown charsets:
- CPPUNIT_ASSERT(!i->second.m_bConverted);
- }
+ // Test extended parameters with different value charsets:
+ input = "TEST/subTST;"
+ "parm1*0*=us-ascii'en'value;PARM1*1*=1;"
+ "parm2*0*=WINDOWS-1250'en-GB'value2%20%80;"
+ "parm3*0*=UNKNOWN'EN'value3;"
+ "parm1*1*=2"; // this parameter is a duplicate,
+ // the scan should end before this parameter
+ // Just scan input for valid string:
+ end = INetMIME::scanContentType(input);
+ CPPUNIT_ASSERT(end != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString(";parm1*1*=2"), OUString(end)); // the invalid end of input
+ // Scan input and parse type, subType and parameters:
+ end = INetMIME::scanContentType(input,
+ &type, &subType, &parameters);
+ CPPUNIT_ASSERT(end != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString(";parm1*1*=2"), OUString(end)); // the invalid end of input
+ CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
+ CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
+ CPPUNIT_ASSERT_EQUAL(
+ INetContentTypeParameterList::size_type(3), parameters.size());
+ i = parameters.find("parm1");
+ CPPUNIT_ASSERT(i != parameters.end());
+ CPPUNIT_ASSERT_EQUAL(OString("us-ascii"), i->second.m_sCharset);
+ CPPUNIT_ASSERT_EQUAL(OString("en"), i->second.m_sLanguage);
+ CPPUNIT_ASSERT_EQUAL(OUString("value1"), i->second.m_sValue);
+ CPPUNIT_ASSERT(i->second.m_bConverted);
+ i = parameters.find("parm2");
+ CPPUNIT_ASSERT(i != parameters.end());
+ CPPUNIT_ASSERT_EQUAL(OString("windows-1250"), i->second.m_sCharset);
+ CPPUNIT_ASSERT_EQUAL(OString("en-gb"), i->second.m_sLanguage);
+ // Euro currency sign, windows-1250 x80 is converted to unicode u20AC:
+ CPPUNIT_ASSERT_EQUAL(OUString(u"value2 \u20AC"), i->second.m_sValue);
+ CPPUNIT_ASSERT(i->second.m_bConverted);
+ i = parameters.find("parm3");
+ CPPUNIT_ASSERT(i != parameters.end());
+ CPPUNIT_ASSERT_EQUAL(OString("unknown"), i->second.m_sCharset);
+ CPPUNIT_ASSERT_EQUAL(OString("en"), i->second.m_sLanguage);
+ // Conversion fails for unknown charsets:
+ CPPUNIT_ASSERT(!i->second.m_bConverted);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index db15b735e664..bd012725e0f6 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1559,25 +1559,23 @@ SvStream& ReadPolygon( SvStream& rIStream, tools::Polygon& rPoly )
else
rPoly.mpImplPolygon->ImplSetSize( nPoints, false );
- {
- // Determine whether we need to write through operators
+ // Determine whether we need to write through operators
#if (SAL_TYPES_SIZEOFLONG) == 4
#ifdef OSL_BIGENDIAN
- if ( rIStream.GetEndian() == SvStreamEndian::BIG )
+ if ( rIStream.GetEndian() == SvStreamEndian::BIG )
#else
- if ( rIStream.GetEndian() == SvStreamEndian::LITTLE )
+ if ( rIStream.GetEndian() == SvStreamEndian::LITTLE )
#endif
- rIStream.ReadBytes(rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point));
- else
+ rIStream.ReadBytes(rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point));
+ else
#endif
+ {
+ for( i = 0; i < nPoints; i++ )
{
- for( i = 0; i < nPoints; i++ )
- {
- sal_Int32 nTmpX(0), nTmpY(0);
- rIStream.ReadInt32( nTmpX ).ReadInt32( nTmpY );
- rPoly.mpImplPolygon->mpPointAry[i].X() = nTmpX;
- rPoly.mpImplPolygon->mpPointAry[i].Y() = nTmpY;
- }
+ sal_Int32 nTmpX(0), nTmpY(0);
+ rIStream.ReadInt32( nTmpX ).ReadInt32( nTmpY );
+ rPoly.mpImplPolygon->mpPointAry[i].X() = nTmpX;
+ rPoly.mpImplPolygon->mpPointAry[i].Y() = nTmpY;
}
}
@@ -1592,26 +1590,24 @@ SvStream& WritePolygon( SvStream& rOStream, const tools::Polygon& rPoly )
// Write number of points
rOStream.WriteUInt16( nPoints );
- {
- // Determine whether we need to write through operators
+ // Determine whether we need to write through operators
#if (SAL_TYPES_SIZEOFLONG) == 4
#ifdef OSL_BIGENDIAN
- if ( rOStream.GetEndian() == SvStreamEndian::BIG )
+ if ( rOStream.GetEndian() == SvStreamEndian::BIG )
#else
- if ( rOStream.GetEndian() == SvStreamEndian::LITTLE )
+ if ( rOStream.GetEndian() == SvStreamEndian::LITTLE )
#endif
- {
- if ( nPoints )
- rOStream.WriteBytes(rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point));
- }
- else
+ {
+ if ( nPoints )
+ rOStream.WriteBytes(rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point));
+ }
+ else
#endif
+ {
+ for( i = 0; i < nPoints; i++ )
{
- for( i = 0; i < nPoints; i++ )
- {
- rOStream.WriteInt32( rPoly.mpImplPolygon->mpPointAry[i].X() )
- .WriteInt32( rPoly.mpImplPolygon->mpPointAry[i].Y() );
- }
+ rOStream.WriteInt32( rPoly.mpImplPolygon->mpPointAry[i].X() )
+ .WriteInt32( rPoly.mpImplPolygon->mpPointAry[i].Y() );
}
}
diff --git a/unotools/qa/unit/testGetEnglishSearchName.cxx b/unotools/qa/unit/testGetEnglishSearchName.cxx
index 6dd97f7c2b1f..aca8be4e1347 100644
--- a/unotools/qa/unit/testGetEnglishSearchName.cxx
+++ b/unotools/qa/unit/testGetEnglishSearchName.cxx
@@ -28,28 +28,27 @@ public:
void Test::testSingleElement()
{
- { // lowercase
- OUString test1 = GetEnglishSearchFontName( "SYMBOL" );
- CPPUNIT_ASSERT_EQUAL( OUString("symbol"),test1);
- //trailing whitespaces
- test1 = GetEnglishSearchFontName( "Symbol " );
- CPPUNIT_ASSERT_EQUAL(OUString("symbol"),test1);
- //no longer remove script suffixes
- test1 = GetEnglishSearchFontName( "Symbol(SIP)" );
- CPPUNIT_ASSERT_EQUAL(OUString("symbol(sip)"),test1);
- test1 = GetEnglishSearchFontName( "CM Roman CE" );
- CPPUNIT_ASSERT_EQUAL( OUString("cmromance"),test1);
- //remove special characters; leave semicolon, numbers
- test1 = GetEnglishSearchFontName( "sy;mb?=ol129" );
- CPPUNIT_ASSERT_EQUAL( OUString("sy;mbol129"),test1);
-
- //transformation
-
- sal_Unicode const transfor[] ={ 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o','n',0};
-
- test1 = GetEnglishSearchFontName(transfor );
- CPPUNIT_ASSERT_EQUAL( OUString("hiraginomarugothicpron"),test1);
- }
+ // lowercase
+ OUString test1 = GetEnglishSearchFontName( "SYMBOL" );
+ CPPUNIT_ASSERT_EQUAL( OUString("symbol"),test1);
+ //trailing whitespaces
+ test1 = GetEnglishSearchFontName( "Symbol " );
+ CPPUNIT_ASSERT_EQUAL(OUString("symbol"),test1);
+ //no longer remove script suffixes
+ test1 = GetEnglishSearchFontName( "Symbol(SIP)" );
+ CPPUNIT_ASSERT_EQUAL(OUString("symbol(sip)"),test1);
+ test1 = GetEnglishSearchFontName( "CM Roman CE" );
+ CPPUNIT_ASSERT_EQUAL( OUString("cmromance"),test1);
+ //remove special characters; leave semicolon, numbers
+ test1 = GetEnglishSearchFontName( "sy;mb?=ol129" );
+ CPPUNIT_ASSERT_EQUAL( OUString("sy;mbol129"),test1);
+
+ //transformation
+
+ sal_Unicode const transfor[] ={ 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o','n',0};
+
+ test1 = GetEnglishSearchFontName(transfor );
+ CPPUNIT_ASSERT_EQUAL( OUString("hiraginomarugothicpron"),test1);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 2300c3b26b82..47153bce8a4b 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1520,9 +1520,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
else if( !bnXRecycled && mpWindowImpl->mpParent && !mpWindowImpl->mpParent->mpWindowImpl->mbFrame && mpWindowImpl->mpParent->ImplIsAntiparallel() )
{
// mirrored window in LTR UI
- {
- nX = mpWindowImpl->mpParent->mnOutWidth - mnOutWidth - nX;
- }
+ nX = mpWindowImpl->mpParent->mnOutWidth - mnOutWidth - nX;
}
// check maPos as well, as it could have been changed for client windows (ImplCallMove())
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 333c518b1370..9ff1da5d0cd2 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1351,54 +1351,52 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
try
{
- {
- //now apply this break at the first paragraph of this section
- uno::Reference< beans::XPropertySet > xRangeProperties( lcl_GetRangeProperties( m_bIsFirstSection, rDM_Impl, m_xStartingRange ) );
+ //now apply this break at the first paragraph of this section
+ uno::Reference< beans::XPropertySet > xRangeProperties( lcl_GetRangeProperties( m_bIsFirstSection, rDM_Impl, m_xStartingRange ) );
- // Handle page breaks with odd/even page numbering. We need to use an extra page style for setting the page style
- // to left/right, because if we set it to the normal style, we'd set it to "First Page"/"Default Style", which would
- // break them (all default pages would be only left or right).
- if ( m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_evenPage) || m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_oddPage) )
+ // Handle page breaks with odd/even page numbering. We need to use an extra page style for setting the page style
+ // to left/right, because if we set it to the normal style, we'd set it to "First Page"/"Default Style", which would
+ // break them (all default pages would be only left or right).
+ if ( m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_evenPage) || m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_oddPage) )
+ {
+ OUString* pageStyle = m_bTitlePage ? &m_sFirstPageStyleName : &m_sFollowPageStyleName;
+ OUString evenOddStyleName = lcl_FindUnusedPageStyleName( rDM_Impl.GetPageStyles()->getElementNames() );
+ uno::Reference< beans::XPropertySet > evenOddStyle(
+ rDM_Impl.GetTextFactory()->createInstance( "com.sun.star.style.PageStyle" ),
+ uno::UNO_QUERY );
+ // Unfortunately using setParent() does not work for page styles, so make a deep copy of the page style.
+ uno::Reference< beans::XPropertySet > pageProperties( m_bTitlePage ? m_aFirstPageStyle : m_aFollowPageStyle );
+ uno::Reference< beans::XPropertySetInfo > pagePropertiesInfo( pageProperties->getPropertySetInfo() );
+ uno::Sequence< beans::Property > propertyList( pagePropertiesInfo->getProperties() );
+ for ( int i = 0; i < propertyList.getLength(); ++i )
{
- OUString* pageStyle = m_bTitlePage ? &m_sFirstPageStyleName : &m_sFollowPageStyleName;
- OUString evenOddStyleName = lcl_FindUnusedPageStyleName( rDM_Impl.GetPageStyles()->getElementNames() );
- uno::Reference< beans::XPropertySet > evenOddStyle(
- rDM_Impl.GetTextFactory()->createInstance( "com.sun.star.style.PageStyle" ),
- uno::UNO_QUERY );
- // Unfortunately using setParent() does not work for page styles, so make a deep copy of the page style.
- uno::Reference< beans::XPropertySet > pageProperties( m_bTitlePage ? m_aFirstPageStyle : m_aFollowPageStyle );
- uno::Reference< beans::XPropertySetInfo > pagePropertiesInfo( pageProperties->getPropertySetInfo() );
- uno::Sequence< beans::Property > propertyList( pagePropertiesInfo->getProperties() );
- for ( int i = 0; i < propertyList.getLength(); ++i )
- {
- if ( (propertyList[i].Attributes & beans::PropertyAttribute::READONLY) == 0 )
- evenOddStyle->setPropertyValue( propertyList[i].Name, pageProperties->getPropertyValue( propertyList[i].Name ) );
- }
- evenOddStyle->setPropertyValue( "FollowStyle", uno::makeAny( *pageStyle ) );
- rDM_Impl.GetPageStyles()->insertByName( evenOddStyleName, uno::makeAny( evenOddStyle ) );
- evenOddStyle->setPropertyValue( "HeaderIsOn", uno::makeAny( false ) );
- evenOddStyle->setPropertyValue( "FooterIsOn", uno::makeAny( false ) );
- CopyHeaderFooter( pageProperties, evenOddStyle );
- *pageStyle = evenOddStyleName; // And use it instead of the original one (which is set as follow of this one).
- if ( m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_evenPage) )
- evenOddStyle->setPropertyValue( getPropertyName( PROP_PAGE_STYLE_LAYOUT ), uno::makeAny( style::PageStyleLayout_LEFT ) );
- else if ( m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_oddPage) )
- evenOddStyle->setPropertyValue( getPropertyName( PROP_PAGE_STYLE_LAYOUT ), uno::makeAny( style::PageStyleLayout_RIGHT ) );
+ if ( (propertyList[i].Attributes & beans::PropertyAttribute::READONLY) == 0 )
+ evenOddStyle->setPropertyValue( propertyList[i].Name, pageProperties->getPropertyValue( propertyList[i].Name ) );
}
+ evenOddStyle->setPropertyValue( "FollowStyle", uno::makeAny( *pageStyle ) );
+ rDM_Impl.GetPageStyles()->insertByName( evenOddStyleName, uno::makeAny( evenOddStyle ) );
+ evenOddStyle->setPropertyValue( "HeaderIsOn", uno::makeAny( false ) );
+ evenOddStyle->setPropertyValue( "FooterIsOn", uno::makeAny( false ) );
+ CopyHeaderFooter( pageProperties, evenOddStyle );
+ *pageStyle = evenOddStyleName; // And use it instead of the original one (which is set as follow of this one).
+ if ( m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_evenPage) )
+ evenOddStyle->setPropertyValue( getPropertyName( PROP_PAGE_STYLE_LAYOUT ), uno::makeAny( style::PageStyleLayout_LEFT ) );
+ else if ( m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_oddPage) )
+ evenOddStyle->setPropertyValue( getPropertyName( PROP_PAGE_STYLE_LAYOUT ), uno::makeAny( style::PageStyleLayout_RIGHT ) );
+ }
- if ( xRangeProperties.is() && rDM_Impl.IsNewDoc() )
- {
- xRangeProperties->setPropertyValue(
- getPropertyName( PROP_PAGE_DESC_NAME ),
- uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName
- : m_sFollowPageStyleName ) );
+ if ( xRangeProperties.is() && rDM_Impl.IsNewDoc() )
+ {
+ xRangeProperties->setPropertyValue(
+ getPropertyName( PROP_PAGE_DESC_NAME ),
+ uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName
+ : m_sFollowPageStyleName ) );
- if (0 <= m_nPageNumber)
- {
- sal_Int16 nPageNumber = m_nPageNumber >= 0 ? static_cast< sal_Int16 >(m_nPageNumber) : 1;
- xRangeProperties->setPropertyValue(getPropertyName(PROP_PAGE_NUMBER_OFFSET),
- uno::makeAny(nPageNumber));
- }
+ if (0 <= m_nPageNumber)
+ {
+ sal_Int16 nPageNumber = m_nPageNumber >= 0 ? static_cast< sal_Int16 >(m_nPageNumber) : 1;
+ xRangeProperties->setPropertyValue(getPropertyName(PROP_PAGE_NUMBER_OFFSET),
+ uno::makeAny(nPageNumber));
}
}
}
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index a805ef7ac5e4..94275f38cb57 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1176,14 +1176,11 @@ void SvXMLExport::ImplExportAutoStyles()
void SvXMLExport::ImplExportMasterStyles()
{
- {
- // <style:master-styles>
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_MASTER_STYLES,
- true, true );
-
- ExportMasterStyles_();
- }
+ // <style:master-styles>
+ SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_MASTER_STYLES,
+ true, true );
+ ExportMasterStyles_();
}
void SvXMLExport::ImplExportContent()
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 3bb5c93cc5a7..f6b0bf97bbf6 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -874,21 +874,19 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax:
}
case ANA_Target:
{
- {
- Any aTarget( mpHelper->convertTarget( rValue ) );
+ Any aTarget( mpHelper->convertTarget( rValue ) );
- if( xAnimate.is() )
- {
- xAnimate->setTarget( aTarget );
- }
- else if( xIter.is() )
- {
- xIter->setTarget( aTarget );
- }
- else if( xCommand.is() )
- {
- xCommand->setTarget( aTarget );
- }
+ if( xAnimate.is() )
+ {
+ xAnimate->setTarget( aTarget );
+ }
+ else if( xIter.is() )
+ {
+ xIter->setTarget( aTarget );
+ }
+ else if( xCommand.is() )
+ {
+ xCommand->setTarget( aTarget );
}
}
break;