[Libreoffice-commits] .: 3 commits - accessibility/source framework/source sd/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Dec 24 07:42:35 PST 2012
accessibility/source/extended/textwindowaccessibility.cxx | 2 +-
framework/source/jobs/jobresult.cxx | 4 +---
framework/source/services/pathsettings.cxx | 4 +---
framework/source/services/substitutepathvars.cxx | 2 +-
framework/source/uielement/menubarmanager.cxx | 2 +-
framework/source/uielement/recentfilesmenucontroller.cxx | 2 +-
sd/source/ui/app/sdmod2.cxx | 4 +---
sd/source/ui/dlg/custsdlg.cxx | 2 +-
sd/source/ui/dlg/sdtreelb.cxx | 3 +--
sd/source/ui/func/fulinend.cxx | 3 +--
sd/source/ui/view/drviews6.cxx | 3 +--
sd/source/ui/view/drviewsg.cxx | 3 +--
12 files changed, 12 insertions(+), 22 deletions(-)
New commits:
commit 4df49447134a08b58a579f5bb65c6e1055b855bd
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Mon Dec 24 16:40:38 2012 +0100
Some cppcheck cleaning in sd
Change-Id: I48b86bf206808e1d19343622b640c80b61b40a48
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 4978b4f..7e25077 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -400,8 +400,6 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
if( nSlot == SID_SD_GRAPHIC_OPTIONS )
eDocType = DOCUMENT_TYPE_DRAW;
- ::sd::ViewShell* pViewShell = NULL;
-
if (pDocSh)
{
pDoc = pDocSh->GetDoc();
@@ -411,7 +409,7 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
if( pDoc && eDocType == pDoc->GetDocumentType() )
pFrameView = pDocSh->GetFrameView();
- pViewShell = pDocSh->GetViewShell();
+ ::sd::ViewShell* pViewShell = pDocSh->GetViewShell();
if (pViewShell != NULL)
pViewShell->WriteFrameViewData();
}
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index d933a73..7ea9c52 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -461,7 +461,6 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p )
void SdDefineCustomShowDlg::CheckCustomShow()
{
sal_Bool bDifferent = sal_False;
- SdPage* pPage = NULL;
SvTreeListEntry* pEntry = NULL;
// Anzahl vergleichen
@@ -490,6 +489,7 @@ void SdDefineCustomShowDlg::CheckCustomShow()
// Seiten-Pointer neu setzen
if( bDifferent )
{
+ SdPage* pPage = NULL;
for( pEntry = aLbCustomPages.First();
pEntry != NULL;
pEntry = aLbCustomPages.Next( pEntry ) )
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 902001c..0fb7588 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1351,7 +1351,6 @@ void SdPageObjsTLB::AddShapeToTransferable (
::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
if (bIsDescriptorFillingPending && pDocShell!=NULL)
{
- bIsDescriptorFillingPending = false;
pDocShell->FillTransferableObjectDescriptor(aObjectDescriptor);
}
@@ -1415,7 +1414,7 @@ void SdPageObjsTLB::AddShapeToTransferable (
return pViewShell.get();
}
}
- catch (uno::Exception e)
+ catch (uno::Exception &e)
{
// When there is an exception then simply use the default value of
// bIsEnabled and disable the controls.
diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx
index e8c053a..14b2b51 100644
--- a/sd/source/ui/func/fulinend.cxx
+++ b/sd/source/ui/func/fulinend.cxx
@@ -99,7 +99,6 @@ void FuLineEnd::DoExecute( SfxRequest& )
SdrObject::Free( pConvPolyObj );
XLineEndListRef pLineEndList = mpDoc->GetLineEndList();
- XLineEndEntry* pEntry;
String aNewName( SdResId( STR_LINEEND ) );
String aDesc( SdResId( STR_DESC_LINEEND ) );
@@ -142,7 +141,7 @@ void FuLineEnd::DoExecute( SfxRequest& )
if( bDifferent )
{
- pEntry = new XLineEndEntry( aPolyPolygon, aName );
+ XLineEndEntry* pEntry = new XLineEndEntry( aPolyPolygon, aName );
pLineEndList->Insert( pEntry, LIST_APPEND);
}
else
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index 9871c3d..001d5d6 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -400,12 +400,11 @@ void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet )
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
const SdrObject* pObj = NULL;
sal_uInt16 nId = SvxBmpMaskChildWindow::GetChildWindowId();
- SvxBmpMask* pDlg = NULL;
sal_Bool bEnable = sal_False;
if ( GetViewFrame()->HasChildWindow( nId ) )
{
- pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
+ SvxBmpMask* pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
if ( pDlg->NeedsColorList() )
pDlg->SetColorList( GetDoc()->GetColorList() );
diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx
index 6318b10..eee39f0 100644
--- a/sd/source/ui/view/drviewsg.cxx
+++ b/sd/source/ui/view/drviewsg.cxx
@@ -84,12 +84,11 @@ void DrawViewShell::GetIMapState( SfxItemSet& rSet )
if( GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) )
{
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- const SdrObject* pObj = NULL;
sal_uLong nMarkCount = rMarkList.GetMarkCount();
if ( nMarkCount == 1 )
{
- pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
SvxIMapDlg* pImageMapDialog = ViewShell::Implementation::GetImageMapDialog();
if ( ( pObj->ISA( SdrGrafObj ) /*|| pObj->ISA( SdrOle2Obj )*/ )
commit d605a49f84e0b8ae25ff7dd42399d3a31747b057
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Mon Dec 24 16:30:51 2012 +0100
Some cppcheck cleaning in framework
Change-Id: If0bb2734bb2c71f69c85496fd59ca860aa14fd75
diff --git a/framework/source/jobs/jobresult.cxx b/framework/source/jobs/jobresult.cxx
index f79fcbd..0af4d78 100644
--- a/framework/source/jobs/jobresult.cxx
+++ b/framework/source/jobs/jobresult.cxx
@@ -105,9 +105,7 @@ JobResult::JobResult( /*IN*/ const css::uno::Any& aResult )
if ( aProtocol.empty() )
return;
- ::comphelper::SequenceAsHashMap::const_iterator pIt = aProtocol.end();
-
- pIt = aProtocol.find(JobConst::ANSWER_DEACTIVATE_JOB());
+ ::comphelper::SequenceAsHashMap::const_iterator pIt = aProtocol.find(JobConst::ANSWER_DEACTIVATE_JOB());
if (pIt != aProtocol.end())
{
pIt->second >>= m_bDeactivate;
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index ee4fd2f..67012ed 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -958,9 +958,7 @@ sal_Bool PathSettings::impl_isValidPath(const ::rtl::OUString& sPath) const
//-----------------------------------------------------------------------------
::rtl::OUString impl_extractBaseFromPropName(const ::rtl::OUString& sPropName)
{
- sal_Int32 i = -1;
-
- i = sPropName.indexOf(POSTFIX_INTERNAL_PATHS);
+ sal_Int32 i = sPropName.indexOf(POSTFIX_INTERNAL_PATHS);
if (i > -1)
return sPropName.copy(0, i);
i = sPropName.indexOf(POSTFIX_USER_PATHS);
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 08dd17f..5db956d 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -747,13 +747,13 @@ rtl::OUString SubstitutePathVariables::GetHomeVariableValue() const
rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "SubstitutePathVariables::GetPathVariableValue" );
- const int PATH_EXTEND_FACTOR = 120;
rtl::OUString aRetStr;
const char* pEnv = getenv( "PATH" );
if ( pEnv )
{
+ const int PATH_EXTEND_FACTOR = 120;
rtl::OUString aTmp;
rtl::OUString aPathList( pEnv, strlen( pEnv ), osl_getThreadTextEncoding() );
rtl::OUStringBuffer aPathStrBuffer( aPathList.getLength() * PATH_EXTEND_FACTOR / 100 );
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 4303f4e..0f2c6ca 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -81,7 +81,7 @@
// Be careful removing this "bad" construct. There are serious problems
// with #define STRICT and including windows.h. Changing this needs some
// redesign on other projects, too. Especially sal/main.h which defines
-// HINSTANCE depending on STRCIT!!!!!!!!!!!!!!!
+// HINSTANCE depending on STRICT!!!!!!!!!!!!!!!
struct SystemMenuData
{
unsigned long nSize;
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 2603b2f..c43ba77 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -146,7 +146,6 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
const sal_uInt32 nCount = m_aRecentFilesItems.size();
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
- char menuShortCut[5] = "~n: ";
::rtl::OUString aMenuShortCut;
if ( i <= 9 )
@@ -155,6 +154,7 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
aMenuShortCut = rtl::OUString( "1~0: " );
else
{
+ char menuShortCut[5] = "~n: ";
menuShortCut[1] = (char)( '1' + i );
aMenuShortCut = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(menuShortCut) );
}
commit 254b11a2c6de6210864f60de491e1917abfbcb14
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Mon Dec 24 16:02:53 2012 +0100
Prefer prefix ++/-- operators for non-primitive types
Change-Id: Ib799053921886d1bd524bf4ffe3f586e4c676572
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 71e6c78..6691856 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -2131,7 +2131,7 @@ void Document::notifySelectionChange( sal_Int32 nFirst, sal_Int32 nLast )
iLast = m_aVisibleEnd;
if ( iFirst < iLast )
{
- for ( Paragraphs::iterator i = iFirst; i != iLast; i++ )
+ for ( Paragraphs::iterator i = iFirst; i != iLast; ++i )
{
::rtl::Reference< ParagraphImpl > xParagraph( getParagraph( i ) );
if ( xParagraph.is() )
More information about the Libreoffice-commits
mailing list