[Libreoffice-commits] .: 7 commits - starmath/inc starmath/source sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Dec 23 13:13:17 PST 2010
starmath/inc/caret.hxx | 3 +
starmath/inc/cursor.hxx | 3 +
starmath/inc/visitors.hxx | 3 +
starmath/source/caret.cxx | 3 +
starmath/source/cursor.cxx | 39 ++++++++++++------------
starmath/source/visitors.cxx | 3 +
sw/source/core/doc/acmplwrd.cxx | 8 ++--
sw/source/core/text/EnhancedPDFExportHelper.cxx | 2 -
sw/source/core/undo/SwRewriter.cxx | 2 -
9 files changed, 42 insertions(+), 24 deletions(-)
New commits:
commit 82ed68267a4686d7a137d0a9ae597dd9e18f115d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 23 20:49:37 2010 +0000
fix typo
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 4db0b1e..25c4522 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -403,7 +403,7 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList,
USHORT eFontDesc = pText->GetFontDesc();
//If we need make segment 1
if(len1 > 0) {
- int start1 = 0,
+ int start1 = 0;
String str = aText.Copy(start1, len1);
pText->ChangeText(str);
++it;
commit 59e030d17f132cbe2706954df9727ea672d6b67e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 23 16:29:38 2010 +0000
cppcheck: prefer prefix variant
diff --git a/sw/source/core/undo/SwRewriter.cxx b/sw/source/core/undo/SwRewriter.cxx
index 9db43b4..abf79a5 100644
--- a/sw/source/core/undo/SwRewriter.cxx
+++ b/sw/source/core/undo/SwRewriter.cxx
@@ -71,7 +71,7 @@ String SwRewriter::Apply(const String & rStr) const
String aResult = rStr;
vector<SwRewriteRule>::const_iterator aIt;
- for (aIt = mRules.begin(); aIt != mRules.end(); aIt++)
+ for (aIt = mRules.begin(); aIt != mRules.end(); ++aIt)
aResult.SearchAndReplaceAll(aIt->first, aIt->second);
return aResult;
commit 72fae3dd74c9b53fcec503d5801b4ec278aae533
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 23 16:28:48 2010 +0000
add mode-lines in here
diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx
index bc22f03..be40598 100644
--- a/starmath/inc/caret.hxx
+++ b/starmath/inc/caret.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
@@ -475,3 +476,5 @@ private:
*/
#endif /* CARET_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 5c61d12..49f1e0c 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
@@ -449,3 +450,5 @@ private:
#endif /* SMCURSOR_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index cff09dc..3dbe887 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
@@ -490,3 +491,5 @@ private:
};
#endif /* SMVISITORS_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/caret.cxx b/starmath/source/caret.cxx
index a847d13..0fd781e 100644
--- a/starmath/source/caret.cxx
+++ b/starmath/source/caret.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
@@ -61,3 +62,5 @@ SmCaretPosGraph::~SmCaretPosGraph(){
delete pNext;
pNext = NULL;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 3e5b117..4db0b1e 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
@@ -1626,3 +1627,5 @@ bool SmNodeListParser::IsUnaryOperator(const SmToken &token) {
bool SmNodeListParser::IsPostfixOperator(const SmToken &token) {
return token.eType == TFACT;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index fbdb379..6ce8112 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
@@ -2570,3 +2571,5 @@ void SmNodeToTextVisitor::Visit( SmVerticalBraceNode* pNode )
Append( pNode->GetToken( ).aText );
LineToText( pScript );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0876092e7930e00763c71f55193e85206687f213
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 23 16:26:03 2010 +0000
cppcheck: prefer prefix variant
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index efc61bc..3e5b117 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -270,7 +270,7 @@ void SmCursor::InsertNodes(SmNodeList* pNewNodes){
SmNodeList::iterator newIt,
patchIt = it, // (pointless default value, fixes compiler warnings)
insIt;
- for(newIt = pNewNodes->begin(); newIt != pNewNodes->end(); newIt++){
+ for(newIt = pNewNodes->begin(); newIt != pNewNodes->end(); ++newIt){
insIt = pLineList->insert(it, *newIt);
if(newIt == pNewNodes->begin())
patchIt = insIt;
@@ -293,7 +293,7 @@ void SmCursor::InsertNodes(SmNodeList* pNewNodes){
SmNodeList::iterator SmCursor::FindPositionInLineList(SmNodeList* pLineList, SmCaretPos aCaretPos) {
//Find iterator for position
SmNodeList::iterator it;
- for(it = pLineList->begin(); it != pLineList->end(); it++){
+ for(it = pLineList->begin(); it != pLineList->end(); ++it){
if(*it == aCaretPos.pSelectedNode){
if((*it)->GetType() == NTEXT){
//Split textnode if needed
@@ -328,9 +328,9 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
if(aIter != pLineList->end())
next = *aIter;
if(aIter != pLineList->begin()) {
- aIter--;
+ --aIter;
prev = *aIter;
- aIter++;
+ ++aIter;
}
//Check if there's textnodes to merge
@@ -354,12 +354,12 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
//Check if there's a SmPlaceNode to remove:
if(prev && next && prev->GetType() == NPLACE && !SmNodeListParser::IsOperator(next->GetToken())){
- aIter--;
+ --aIter;
aIter = pLineList->erase(aIter);
delete prev;
//Return caret pos infront of aIter
if(aIter != pLineList->begin())
- aIter--; //Thus find node before aIter
+ --aIter; //Thus find node before aIter
if(aIter == pLineList->begin())
return SmCaretPos();
if((*aIter)->GetType() == NTEXT)
@@ -405,7 +405,7 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList,
int start1 = 0,
String str = aText.Copy(start1, len1);
pText->ChangeText(str);
- it++;
+ ++it;
} else {//Remove it if not needed
it = pLineList->erase(it);
delete pText;
@@ -435,7 +435,7 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList,
delete pNode;
}
} else
- it++;
+ ++it;
}
return retval;
}
@@ -484,15 +484,15 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
SmNode* pSubject;
bool bPatchLine = pSelectedNodesList->size() > 0; //If the line should be patched later
if(it != pLineList->begin()) {
- it--;
+ --it;
pSubject = *it;
- it++;
+ ++it;
} else {
//Create a new place node
pSubject = new SmPlaceNode();
pSubject->Prepare(pDocShell->GetFormat(), *pDocShell);
it = pLineList->insert(it, pSubject);
- it++;
+ ++it;
bPatchLine = true; //We've modified the line it should be patched later.
}
@@ -504,7 +504,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
pSubSup = new SmSubSupNode(token);
pSubSup->SetBody(pSubject);
*(--it) = pSubSup;
- it++;
+ ++it;
}else
pSubSup = (SmSubSupNode*)pSubject;
//pSubject shouldn't be referenced anymore, pSubSup is the SmSubSupNode in pLineList we wish to edit.
@@ -842,7 +842,7 @@ bool SmCursor::InsertRow() {
//Make sure it is valid again
it = pLineList->end();
if(it != pLineList->begin())
- it--;
+ --it;
if(pNewLineList->size() == 0)
pNewLineList->push_front(new SmPlaceNode());
//Parse new line
@@ -1210,7 +1210,7 @@ SmNodeList* SmCursor::CloneList(SmNodeList* pList){
SmNodeList* pClones = new SmNodeList();
SmNodeList::iterator it;
- for(it = pList->begin(); it != pList->end(); it++){
+ for(it = pList->begin(); it != pList->end(); ++it){
SmNode *pClone = aCloneFactory.Clone(*it);
pClones->push_back(pClone);
}
@@ -1223,7 +1223,7 @@ void SmCursor::SetClipboard(SmNodeList* pList){
if(pClipboard){
//Delete all nodes on the clipboard
SmNodeList::iterator it;
- for(it = pClipboard->begin(); it != pClipboard->end(); it++)
+ for(it = pClipboard->begin(); it != pClipboard->end(); ++it)
delete (*it);
delete pClipboard;
}
@@ -1472,7 +1472,7 @@ SmNode* SmNodeListParser::Parse(SmNodeList* list, bool bDeleteErrorNodes){
delete *it;
it = pList->erase(it);
}else
- it++;
+ ++it;
}
}
SmNode* retval = Expression();
commit 84b0c5cdab86db46faf97c6ed3e2dd9c1cfb20b7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 23 16:23:32 2010 +0000
cppcheck: the scope of this variable can be reduced
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 249d6a4..efc61bc 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -393,8 +393,7 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList,
SmTextNode* pText = (SmTextNode*)*it;
String aText = pText->GetText();
//Start and lengths of the segments, 2 is the selected segment
- int start1 = 0,
- start2 = pText->GetSelectionStart(),
+ int start2 = pText->GetSelectionStart(),
start3 = pText->GetSelectionEnd(),
len1 = start2 - 0,
len2 = start3 - start2,
@@ -403,6 +402,7 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList,
USHORT eFontDesc = pText->GetFontDesc();
//If we need make segment 1
if(len1 > 0) {
+ int start1 = 0,
String str = aText.Copy(start1, len1);
pText->ChangeText(str);
it++;
commit 9dcb11cc29e6243a8348c6672d7bdd7434e73ad4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 23 15:07:14 2010 +0000
cppcheck: prefer prefix variant
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 12c56ca..f7f8fea 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -165,7 +165,7 @@ void SwAutoCompleteClient::Modify(SfxPoolItem *pOld, SfxPoolItem *)
void SwAutoCompleteWord_Impl::AddDocument(SwDoc& rDoc)
{
SwAutoCompleteClientVector::iterator aIt;
- for(aIt = aClientVector.begin(); aIt != aClientVector.end(); aIt++)
+ for(aIt = aClientVector.begin(); aIt != aClientVector.end(); ++aIt)
{
if(&aIt->GetDoc() == &rDoc)
return;
@@ -176,7 +176,7 @@ void SwAutoCompleteWord_Impl::AddDocument(SwDoc& rDoc)
void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc)
{
SwAutoCompleteClientVector::iterator aIt;
- for(aIt = aClientVector.begin(); aIt != aClientVector.end(); aIt++)
+ for(aIt = aClientVector.begin(); aIt != aClientVector.end(); ++aIt)
{
if(&aIt->GetDoc() == &rDoc)
{
@@ -204,7 +204,7 @@ SwAutoCompleteString::~SwAutoCompleteString()
void SwAutoCompleteString::AddDocument(const SwDoc& rDoc)
{
SwDocPtrVector::iterator aIt;
- for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); aIt++)
+ for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); ++aIt)
{
if(*aIt == &rDoc)
return;
@@ -216,7 +216,7 @@ void SwAutoCompleteString::AddDocument(const SwDoc& rDoc)
sal_Bool SwAutoCompleteString::RemoveDocument(const SwDoc& rDoc)
{
SwDocPtrVector::iterator aIt;
- for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); aIt++)
+ for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); ++aIt)
{
if(*aIt == &rDoc)
{
commit df5b0fe6567fcfd763add472278ce970b98bfbb2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 23 15:03:39 2010 +0000
cppcheck: prefer prefix variant
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index fb9634d..773bf33 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -2118,7 +2118,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
else
pPDFExtOutDevData->SetLinkURL( aIBeg->nLinkId, aBookmarkName );
- aIBeg++;
+ ++aIBeg;
}
rBookmarks.clear();
}
More information about the Libreoffice-commits
mailing list