[Libreoffice-commits] .: 2 commits - editeng/source sc/inc sc/source unusedcode.easy

2012-04-24 Thread Caolán McNamara
 editeng/source/editeng/editdoc.cxx |5 -
 editeng/source/editeng/editdoc.hxx |1 -
 sc/inc/chartlis.hxx|2 --
 sc/source/core/tool/chartlis.cxx   |   15 ---
 unusedcode.easy|2 --
 5 files changed, 25 deletions(-)

New commits:
commit 93a6aeb965c2d77767178e62475378f69b326414
Author: Santiago Martinez smvar...@gmail.com
Date:   Mon Apr 23 19:37:15 2012 +0200

Remove unused code in sc.

diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 3a92519..2c7a0b7 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -88,8 +88,6 @@ private:
 
 public:
 ScChartListener( const rtl::OUString rName, ScDocument* pDoc,
- const ScRange rRange );
-ScChartListener( const rtl::OUString rName, ScDocument* pDoc,
  const ScRangeListRef rRangeListRef );
 ScChartListener( const rtl::OUString rName, ScDocument* pDoc,
  ::std::vectorScTokenRef* pTokens );
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 79da0c9..c655eba 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -120,21 +120,6 @@ boost::unordered_setsal_uInt16 
ScChartListener::ExternalRefListener::getAllFi
 // 
 
 ScChartListener::ScChartListener( const rtl::OUString rName, ScDocument* 
pDocP,
-const ScRange rRange ) :
-SvtListener(),
-mpExtRefListener(NULL),
-mpTokens(new vectorScTokenRef),
-maName(rName),
-pUnoData( NULL ),
-pDoc( pDocP ),
-bUsed( false ),
-bDirty( false ),
-bSeriesRangesScheduled( false )
-{
-SetRangeList( rRange );
-}
-
-ScChartListener::ScChartListener( const rtl::OUString rName, ScDocument* 
pDocP,
 const ScRangeListRef rRangeList ) :
 SvtListener(),
 mpExtRefListener(NULL),
diff --git a/unusedcode.easy b/unusedcode.easy
index e10c47b..b4fd869 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -35,7 +35,6 @@ ScAddInDocs::Insert(ScAddInDocs const*, unsigned short, 
unsigned short)
 ScAddInDocs::Insert(ScDocument* const, unsigned short)
 ScAddInDocs::Insert(ScDocument* const*, unsigned short)
 ScAddInDocs::Remove(ScDocument* const, unsigned short)
-ScChartListener::ScChartListener(rtl::OUString const, ScDocument*, ScRange 
const)
 ScChartListener::SetName(rtl::OUString const)
 ScCompressedArrayint, unsigned char::GetEntryCount() const
 ScCompressedArrayint, unsigned short::CopyFrom(ScCompressedArrayint, 
unsigned short const, int, int, long)
commit 444e47bfdd8df18f8e37d0271dc1d48e55cc9c12
Author: Vicent Vendrell viven...@yahoo.es
Date:   Mon Apr 23 16:43:30 2012 +0200

Removed unused code from editeng

Committer:Vicent Vendrell viven...@yahoo.es

On branch master

modified:   editeng/source/editeng/editdoc.cxx
modified:   editeng/source/editeng/editdoc.hxx
modified:   unusedcode.easy

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 23549a7..110daf5 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2711,11 +2711,6 @@ size_t CharAttribList::Count() const
 return aAttribs.size();
 }
 
-void CharAttribList::Clear()
-{
-aAttribs.clear();
-}
-
 const EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, 
sal_uInt16 nPos ) const
 {
 // Backwards, if one ends where the next starts.
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 531652c..8dfe4f6 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -236,7 +236,6 @@ public:
 voidOptimizeRanges( SfxItemPool rItemPool );
 
 size_t Count() const;
-void Clear();
 
 voidInsertAttrib( EditCharAttrib* pAttrib );
 
diff --git a/unusedcode.easy b/unusedcode.easy
index e1cd14b..e10c47b 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1,5 +1,4 @@
 
CertificateExtension_XmlSecImpl::setCertExtn(com::sun::star::uno::Sequencesigned
 char, com::sun::star::uno::Sequencesigned char, unsigned char)
-CharAttribList::Clear()
 Dialog::Dialog(Window*, ResId const)
 EditEngine::GetNextVisPortion(ParaPortion const*) const
 FmFieldWinMgr::GetChildWindowId()
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - editeng/source

2012-04-04 Thread Kohei Yoshida
 editeng/source/editeng/editattr.cxx |   21 +++--
 editeng/source/editeng/editattr.hxx |   29 ++---
 editeng/source/editeng/editdoc.cxx  |   77 +---
 editeng/source/editeng/editdoc.hxx  |   22 --
 editeng/source/editeng/editview.cxx |2 
 editeng/source/editeng/edtspell.cxx |6 +-
 editeng/source/editeng/impedit2.cxx |   58 ++-
 editeng/source/editeng/impedit3.cxx |   20 +
 editeng/source/editeng/impedit4.cxx |   55 +
 9 files changed, 184 insertions(+), 106 deletions(-)

New commits:
commit 0e355da592008257ec02bd68d37ff67b32eaa8c6
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Apr 3 17:10:10 2012 -0400

De-coupled ContentNode from XubString inheritance.

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 373e608..c444950 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1154,6 +1154,16 @@ void EditPaM::SetNode(ContentNode* p)
 pNode = p;
 }
 
+bool EditPaM::IsParaStart() const
+{
+return nIndex == 0;
+}
+
+bool EditPaM::IsParaEnd() const
+{
+return nIndex == pNode-Len();
+}
+
 sal_Bool EditPaM::DbgIsBuggy( EditDoc rDoc )
 {
 if ( !pNode )
@@ -1275,7 +1285,7 @@ ContentNode::ContentNode( SfxItemPool rPool ) : 
aContentAttribs( rPool )
 }
 
 ContentNode::ContentNode( const XubString rStr, const ContentAttribs 
rContentAttribs ) :
-XubString( rStr ), aContentAttribs( rContentAttribs )
+maString(rStr), aContentAttribs(rContentAttribs)
 {
 DBG_CTOR( EE_ContentNode, 0 );
 pWrongList = NULL;
@@ -1414,7 +1424,7 @@ void ContentNode::ExpandAttribs( sal_uInt16 nIndex, 
sal_uInt16 nNew, SfxItemPool
 
 if ( pWrongList )
 {
-sal_Bool bSep = ( GetChar( nIndex ) == ' ' ) || IsFeature( nIndex );
+bool bSep = ( maString.GetChar( nIndex ) == ' ' ) || IsFeature( nIndex 
);
 pWrongList-TextInserted( nIndex, nNew, bSep );
 }
 
@@ -1515,7 +1525,7 @@ void ContentNode::CopyAndCutAttribs( ContentNode* 
pPrevNode, SfxItemPool rPool,
 {
 DBG_ASSERT( pPrevNode, Copy of attributes to a null pointer? );
 
-xub_StrLen nCut = pPrevNode-Len();
+sal_uInt16 nCut = pPrevNode-Len();
 
 size_t nAttr = 0;
 CharAttribList::AttribsType rPrevAttribs = 
pPrevNode-GetCharAttribs().GetAttribs();
@@ -1567,7 +1577,7 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode )
 {
 DBG_ASSERT( pNextNode, Copy of attributes to a null pointer? );
 
-sal_uInt16 nNewStart = Len();
+sal_uInt16 nNewStart = maString.Len();
 
 #if OSL_DEBUG_LEVEL  2
 OSL_ENSURE( aCharAttribList.DbgCheckAttribs(), Attribute before 
AppendAttribs broken );
@@ -1658,6 +1668,61 @@ void ContentNode::DestroyWrongList()
 pWrongList = NULL;
 }
 
+bool ContentNode::IsFeature( sal_uInt16 nPos ) const
+{
+return maString.GetChar(nPos) == CH_FEATURE;
+}
+
+sal_uInt16 ContentNode::Len() const
+{
+return maString.Len();
+}
+
+const XubString ContentNode::GetString() const
+{
+return maString;
+}
+
+void ContentNode::SetChar(sal_uInt16 nPos, sal_Unicode c)
+{
+maString.SetChar(nPos, c);
+}
+
+void ContentNode::Insert(const XubString rStr, sal_uInt16 nPos)
+{
+maString.Insert(rStr, nPos);
+}
+
+void ContentNode::Append(const XubString rStr)
+{
+maString.Append(rStr);
+}
+
+void ContentNode::Erase(sal_uInt16 nPos)
+{
+maString.Erase(nPos);
+}
+
+void ContentNode::Erase(sal_uInt16 nPos, sal_uInt16 nCount)
+{
+maString.Erase(nPos, nCount);
+}
+
+XubString ContentNode::Copy(sal_uInt16 nPos) const
+{
+return maString.Copy(nPos);
+}
+
+XubString ContentNode::Copy(sal_uInt16 nPos, sal_uInt16 nCount) const
+{
+return maString.Copy(nPos, nCount);
+}
+
+sal_Unicode ContentNode::GetChar(sal_uInt16 nPos) const
+{
+return maString.GetChar(nPos);
+}
+
 void ContentNode::CreateWrongList()
 {
 DBG_ASSERT( !pWrongList, WrongList already exist! );
@@ -2050,7 +2115,7 @@ XubString EditDoc::GetParaAsString(
 //!! beware of sub string length  of -1 which is also defined as 
STRING_LEN and
 //!! thus would result in adding the whole sub string up to the end of 
the node !!
 if (nEnd  nIndex)
-aStr += XubString( *pNode, nIndex, nEnd - nIndex );
+aStr += XubString(pNode-GetString(), nIndex, nEnd - nIndex);
 
 if ( pNextFeature )
 {
@@ -2240,7 +2305,7 @@ EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, 
ContentNode* pRight )
 // First the attributes, otherwise nLen will not be correct!
 pLeft-AppendAttribs( pRight );
 // then the Text...
-*pLeft += *pRight;
+pLeft-Append(pRight-GetString());
 
 // the one to the right disappears.
 RemoveItemsFromPool(*pRight);
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index bd05ae1..8b70806 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ 

[Libreoffice-commits] .: 2 commits - editeng/source

2012-03-29 Thread Lubos Lunak
 editeng/source/editeng/editdoc.cxx  |6 +--
 editeng/source/editeng/editdoc.hxx  |8 ++--
 editeng/source/editeng/editdoc2.cxx |6 +--
 editeng/source/editeng/editeng.cxx  |   30 +++
 editeng/source/editeng/editundo.cxx |8 ++--
 editeng/source/editeng/eertfpar.cxx |   10 ++---
 editeng/source/editeng/impedit.cxx  |6 +--
 editeng/source/editeng/impedit2.cxx |   70 ++--
 editeng/source/editeng/impedit3.cxx |   28 +++---
 editeng/source/editeng/impedit4.cxx |   16 
 editeng/source/editeng/impedit5.cxx |   28 +++---
 11 files changed, 108 insertions(+), 108 deletions(-)

New commits:
commit 571876c1234ae55aab0198c7e2caf9049fcd230e
Author: Luboš Luňák l.lu...@suse.cz
Date:   Thu Mar 29 08:14:07 2012 +0200

SaveGetObject() is presumably meant to be safe rather than saving

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 010f40f..43c64c4 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1341,12 +1341,12 @@ static const sal_Unicode aCR[] = { 0x0d, 0x00 };
 static const sal_Unicode aLF[] = { 0x0a, 0x00 };
 static const sal_Unicode aCRLF[] = { 0x0d, 0x0a, 0x00 };
 
-const ContentNode* EditDoc::SaveGetObject(size_t nPos) const
+const ContentNode* EditDoc::SafeGetObject(size_t nPos) const
 {
 return ( nPos  Count() ) ? GetObject( nPos ) : 0;
 }
 
-ContentNode* EditDoc::SaveGetObject(size_t nPos)
+ContentNode* EditDoc::SafeGetObject(size_t nPos)
 {
 return ( nPos  Count() ) ? GetObject( nPos ) : 0;
 }
@@ -1400,7 +1400,7 @@ XubString EditDoc::GetText( LineEnd eEnd ) const
 
 XubString EditDoc::GetParaAsString( sal_uInt16 nNode ) const
 {
-return GetParaAsString( SaveGetObject( nNode ) );
+return GetParaAsString( SafeGetObject( nNode ) );
 }
 
 XubString EditDoc::GetParaAsString(
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 0114c09..59010d6 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -658,8 +658,8 @@ public:
 long GetYOffset(const ParaPortion* pPPortion) const;
 sal_uInt16 FindParagraph(long nYOffset) const;
 
-const ParaPortion* SaveGetObject(size_t nPos) const;
-ParaPortion* SaveGetObject(size_t nPos);
+const ParaPortion* SafeGetObject(size_t nPos) const;
+ParaPortion* SafeGetObject(size_t nPos);
 
 sal_uInt16 GetPos(const ParaPortion* p) const;
 ParaPortion* operator[](size_t nPos);
@@ -805,8 +805,8 @@ public:
 voidFindAttribs( ContentNode* pNode, sal_uInt16 nStartPos, 
sal_uInt16 nEndPos, SfxItemSet rCurSet );
 
 sal_uInt16 GetPos( const ContentNode* pNode ) const { return 
ContentList::GetPos(pNode); }
-const ContentNode* SaveGetObject(size_t nPos) const;
-ContentNode* SaveGetObject(size_t nPos);
+const ContentNode* SafeGetObject(size_t nPos) const;
+ContentNode* SafeGetObject(size_t nPos);
 
 static XubStringGetSepStr( LineEnd eEnd );
 };
diff --git a/editeng/source/editeng/editdoc2.cxx 
b/editeng/source/editeng/editdoc2.cxx
index 474e3fa..b22c10b 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -460,12 +460,12 @@ sal_uInt16 ParaPortionList::FindParagraph(long nYOffset) 
const
 return EE_PARA_NOT_FOUND;
 }
 
-const ParaPortion* ParaPortionList::SaveGetObject(size_t nPos) const
+const ParaPortion* ParaPortionList::SafeGetObject(size_t nPos) const
 {
 return nPos  maPortions.size() ? maPortions[nPos] : NULL;
 }
 
-ParaPortion* ParaPortionList::SaveGetObject(size_t nPos)
+ParaPortion* ParaPortionList::SafeGetObject(size_t nPos)
 {
 return nPos  maPortions.size() ? maPortions[nPos] : NULL;
 }
@@ -476,7 +476,7 @@ void ParaPortionList::DbgCheck( EditDoc rDoc)
 DBG_ASSERT( Count() == rDoc.Count(), ParaPortionList::DbgCheck() - 
Count() unequal! );
 for ( sal_uInt16 i = 0; i  Count(); i++ )
 {
-DBG_ASSERT( SaveGetObject(i), ParaPortionList::DbgCheck() - 
Null-Pointer in List! );
+DBG_ASSERT( SafeGetObject(i), ParaPortionList::DbgCheck() - 
Null-Pointer in List! );
 DBG_ASSERT( GetObject(i)-GetNode(), ParaPortionList::DbgCheck() - 
Null-Pointer in List(2)! );
 DBG_ASSERT( GetObject(i)-GetNode() == rDoc.GetObject(i), 
ParaPortionList::DbgCheck() - Entries intersect! );
 }
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 275a992..2b246c9 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -503,7 +503,7 @@ sal_uInt16 EditEngine::GetScriptType( const ESelection 
rSelection ) const
 LanguageType EditEngine::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const
 {
 DBG_CHKTHIS( EditEngine, 0 );
-ContentNode* pNode = pImpEditEngine-GetEditDoc().SaveGetObject( nPara );
+ContentNode* pNode = pImpEditEngine-GetEditDoc().SafeGetObject( nPara );
 DBG_ASSERT( pNode, 

[Libreoffice-commits] .: 2 commits - editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdbg.cxx  |   12 ++--
 editeng/source/editeng/editdoc.hxx  |   14 +++---
 editeng/source/editeng/editdoc2.cxx |   11 +++
 editeng/source/editeng/editundo.cxx |   21 +++--
 editeng/source/editeng/impedit5.cxx |2 +-
 5 files changed, 32 insertions(+), 28 deletions(-)

New commits:
commit d192756c71519b1f013bbaa1a0594d46606a6336
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 13:35:19 2012 -0400

No more CharAttribArray.

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index fc9c562..a1b4575 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -496,19 +496,19 @@ sal_Bool ParaPortion::DbgCheckTextPortions()
 }
 #endif
 
-sal_Bool CheckOrderedList( CharAttribArray rAttribs, sal_Bool bStart )
+bool CheckOrderedList(const CharAttribList::AttribsType rAttribs, bool bStart)
 {
 sal_uInt16 nPrev = 0;
-for ( sal_uInt16 nAttr = 0; nAttr  rAttribs.Count(); nAttr++ )
+for (size_t nAttr = 0; nAttr  rAttribs.size(); ++nAttr)
 {
-EditCharAttrib* pAttr = rAttribs[nAttr];
-sal_uInt16 nCur = bStart ? pAttr-GetStart() : pAttr-GetEnd();
+const EditCharAttrib rAttr = rAttribs[nAttr];
+sal_uInt16 nCur = bStart ? rAttr.GetStart() : rAttr.GetEnd();
 if ( nCur  nPrev )
-return sal_False;
+return false;
 
 nPrev = nCur;
 }
-return sal_True;
+return true;
 }
 
 #endif
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 2bd5151..1114990 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -117,9 +117,6 @@ struct WritingDirectionInfo
 
 typedef std::deque WritingDirectionInfo  WritingDirectionInfos;
 
-typedef EditCharAttrib* EditCharAttribPtr;
-SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0 )
-
 class ContentAttribsInfo
 {
 private:
@@ -804,7 +801,7 @@ inline EditCharAttrib* 
GetAttrib(CharAttribList::AttribsType rAttribs, size_t n
 return (nAttr  rAttribs.size()) ? rAttribs[nAttr] : NULL;
 }
 
-sal_Bool CheckOrderedList( CharAttribArray rAttribs, sal_Bool bStart );
+bool CheckOrderedList(const CharAttribList::AttribsType rAttribs, bool 
bStart);
 
 // -
 // class EditEngineItemPool
commit 38e07aab9eb8c3c1d18038857b5dda28aace5bff
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 13:31:27 2012 -0400

One less use of CharAttribArray.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 7ddaa39..2bd5151 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -123,16 +123,19 @@ SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0 )
 class ContentAttribsInfo
 {
 private:
+typedef boost::ptr_vectorEditCharAttrib CharAttribsType;
+
 SfxItemSet  aPrevParaAttribs;
-CharAttribArray aPrevCharAttribs;
+CharAttribsType aPrevCharAttribs;
 
 public:
 ContentAttribsInfo( const SfxItemSet rParaAttribs );
 
 const SfxItemSet   GetPrevParaAttribs() const  { return 
aPrevParaAttribs; }
-const CharAttribArray  GetPrevCharAttribs() const  { return 
aPrevCharAttribs; }
+const CharAttribsType  GetPrevCharAttribs() const  { return 
aPrevCharAttribs; }
 
-CharAttribArrayGetPrevCharAttribs(){ return 
aPrevCharAttribs; }
+void RemoveAllCharAttribsFromPool(SfxItemPool rPool) const;
+void AppendCharAttrib(EditCharAttrib* pNew);
 };
 
 typedef ContentAttribsInfo* ContentAttribsInfoPtr;
diff --git a/editeng/source/editeng/editdoc2.cxx 
b/editeng/source/editeng/editdoc2.cxx
index 67c0d38..c13b656 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -395,6 +395,17 @@ ContentAttribsInfo::ContentAttribsInfo( const SfxItemSet 
rParaAttribs ) :
 {
 }
 
+void ContentAttribsInfo::RemoveAllCharAttribsFromPool(SfxItemPool rPool) const
+{
+CharAttribsType::const_iterator it = aPrevCharAttribs.begin(), itEnd = 
aPrevCharAttribs.end();
+for (; it != itEnd; ++it)
+rPool.Remove(*it-GetItem());
+}
+
+void ContentAttribsInfo::AppendCharAttrib(EditCharAttrib* pNew)
+{
+aPrevCharAttribs.push_back(pNew);
+}
 
 void ConvertItem( SfxPoolItem rPoolItem, MapUnit eSourceUnit, MapUnit 
eDestUnit )
 {
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index 1b96e14..e29043b 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -549,13 +549,7 @@ EditUndoSetAttribs::~EditUndoSetAttribs()
 {
 ContentAttribsInfo* pInf = aPrevAttribs[n];
 DBG_ASSERT( pInf, Undo_DTOR (SetAttribs): pInf = NULL! );
-for ( sal_uInt16 nAttr = 0; nAttr  
pInf-GetPrevCharAttribs().Count(); nAttr++ )
-{
-EditCharAttrib* pX = 

[Libreoffice-commits] .: 2 commits - editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdoc.hxx  |   10 +++--
 editeng/source/editeng/editdoc2.cxx |6 +++--
 editeng/source/editeng/editeng.cxx  |2 -
 editeng/source/editeng/editundo.cxx |   40 +++-
 editeng/source/editeng/editundo.hxx |7 --
 editeng/source/editeng/impedit5.cxx |2 -
 6 files changed, 41 insertions(+), 26 deletions(-)

New commits:
commit 48cd6ac1ec7e92a9c9a21f5365db4f9ff5fde93c
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 15:31:05 2012 -0400

Fix tinderbox error  some cleanup.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 7551eca..7f760f3 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -298,10 +298,11 @@ SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0 )
 
 class ContentList : public DummyContentList
 {
-  sal_uInt16 nLastCache;
+sal_uInt16 nLastCache;
+
 public:
-  ContentList() : DummyContentList( 0 ), nLastCache(0) {}
-  sal_uInt16 GetPos( const ContentNodePtr rPtr ) const;
+ContentList();
+sal_uInt16 GetPos(ContentNode* p) const;
 };
 
 // -
diff --git a/editeng/source/editeng/editdoc2.cxx 
b/editeng/source/editeng/editdoc2.cxx
index c13b656..68da6aa 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -337,10 +337,12 @@ sal_uInt16 ParaPortionList::GetPos( const ParaPortionPtr 
rPtr ) const
((ParaPortionList *)this)-nLastCache );
 }
 
-sal_uInt16 ContentList::GetPos( const ContentNodePtr rPtr ) const
+ContentList::ContentList() : DummyContentList( 0 ), nLastCache(0) {}
+
+sal_uInt16 ContentList::GetPos(ContentNode* p) const
 {
 return FastGetPos( reinterpret_castconst VoidPtr *( GetData() ),
-   Count(), static_castVoidPtr( rPtr ),
+   Count(), static_castVoidPtr(p),
((ContentList *)this)-nLastCache );
 }
 
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 0954d51..9fcd0a2 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2113,7 +2113,7 @@ void EditEngine::RemoveFields( sal_Bool bKeepFieldText, 
TypeId aType )
 const SvxFieldData* pFldData = static_castconst 
SvxFieldItem*(rAttr.GetItem())-GetField();
 if ( pFldData  ( !aType || ( pFldData-IsA( aType ) ) ) )
 {
-DBG_ASSERT( rAttr-GetItem()-ISA( SvxFieldItem ), no 
field item... );
+DBG_ASSERT( dynamic_castconst 
SvxFieldItem*(rAttr.GetItem()), no field item... );
 EditSelection aSel( EditPaM(pNode, rAttr.GetStart()), 
EditPaM(pNode, rAttr.GetEnd()) );
 String aFieldText = static_castconst 
EditCharAttribField(rAttr).GetFieldValue();
 pImpEditEngine-ImpInsertText( aSel, aFieldText );
commit 17cc39f2b0ef13efdfb052fe6b815508879fb755
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 14:54:42 2012 -0400

ContentInfoArray is gone.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 1114990..7551eca 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -135,9 +135,6 @@ public:
 void AppendCharAttrib(EditCharAttrib* pNew);
 };
 
-typedef ContentAttribsInfo* ContentAttribsInfoPtr;
-SV_DECL_PTRARR( ContentInfoArray, ContentAttribsInfoPtr, 1 )
-
 //  --
 //  class SvxColorList
 //  --
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index e29043b..b59b71a 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -540,18 +540,26 @@ EditUndoSetAttribs::EditUndoSetAttribs( ImpEditEngine* 
_pImpEE, const ESelection
 nSpecial = 0;
 }
 
+namespace {
+
+struct RemoveAttribsFromPool : std::unary_functionContentAttribsInfo, void
+{
+SfxItemPool mrPool;
+public:
+RemoveAttribsFromPool(SfxItemPool rPool) : mrPool(rPool) {}
+void operator() (ContentAttribsInfo rInfo)
+{
+rInfo.RemoveAllCharAttribsFromPool(mrPool);
+}
+};
+
+}
+
 EditUndoSetAttribs::~EditUndoSetAttribs()
 {
 // Get Items from Pool...
 SfxItemPool* pPool = aNewAttribs.GetPool();
-sal_uInt16 nContents = aPrevAttribs.Count();
-for ( sal_uInt16 n = 0; n  nContents; n++ )
-{
-ContentAttribsInfo* pInf = aPrevAttribs[n];
-DBG_ASSERT( pInf, Undo_DTOR (SetAttribs): pInf = NULL! );
-pInf-RemoveAllCharAttribsFromPool(*pPool);
-delete pInf;
-}
+std::for_each(aPrevAttribs.begin(), aPrevAttribs.end(), 
RemoveAttribsFromPool(*pPool));
 }
 
 void EditUndoSetAttribs::Undo()
@@ -561,20 +569,19 @@ void 

[Libreoffice-commits] .: 2 commits - editeng/source

2012-02-03 Thread Michael Stahl
 editeng/source/editeng/edtspell.cxx |   65 
 1 file changed, 37 insertions(+), 28 deletions(-)

New commits:
commit 874f2e53b24ad24d4e99f0df54ba6539d1958371
Author: Michael Stahl mst...@redhat.com
Date:   Fri Feb 3 14:19:47 2012 +0100

WrongList::TextInserted: fix STL crash

vector iterators and insert don't mix well
(regression from dfbf0cabfa8310502e19642d56c746cc0d454d27)

diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index f13fb1a..eda0d61 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -242,48 +242,51 @@ void WrongList::TextInserted( sal_uInt16 nPos, sal_uInt16 
nNew, sal_Bool bPosIsS
 nInvalidEnd = nPos+nNew;
 }
 
-for (WrongList::iterator i = begin(); i != end(); ++i)
+for (WrongList::size_type i = 0; i  size(); ++i)
 {
+WrongRange  rWrong = (*this)[i]; // why does this thing derive vector?
 sal_Bool bRefIsValid = sal_True;
-if (i-nEnd = nPos)
+if (rWrong.nEnd = nPos)
 {
 // Move all Wrongs after the insert position...
-if (i-nStart  nPos)
+if (rWrong.nStart  nPos)
 {
-i-nStart += nNew;
-i-nEnd += nNew;
+rWrong.nStart += nNew;
+rWrong.nEnd += nNew;
 }
 // 1: Starts before and goes until nPos...
-else if (i-nEnd == nPos)
+else if (rWrong.nEnd == nPos)
 {
 // Should be halted at a blank!
 if ( !bPosIsSep )
-i-nEnd += nNew;
+rWrong.nEnd += nNew;
 }
 // 2: Starts before and goes until after nPos...
-else if (i-nStart  nPos  i-nEnd  nPos)
+else if ((rWrong.nStart  nPos)  (rWrong.nEnd  nPos))
 {
-i-nEnd += nNew;
+rWrong.nEnd += nNew;
 // When a separator remove and re-examine the Wrong
 if ( bPosIsSep )
 {
 // Split Wrong...
-WrongRange aNewWrong(i-nStart, nPos);
-i-nStart = nPos + 1;
-insert(i, aNewWrong);
-bRefIsValid = sal_False;// Reference no longer valid 
after Insert, the other was inserted in front of this position
+WrongRange aNewWrong(rWrong.nStart, nPos);
+rWrong.nStart = nPos + 1;
+insert(begin() + i, aNewWrong);
+// Reference no longer valid after Insert, the other
+// was inserted in front of this position
+bRefIsValid = false;
 ++i; // Not this again...
 }
 }
 // 3: Attribute starts at position ..
-else if (i-nStart == nPos)
+else if (rWrong.nStart == nPos)
 {
-i-nEnd += nNew;
+rWrong.nEnd += nNew;
 if ( bPosIsSep )
-++(i-nStart);
+++(rWrong.nStart);
 }
 }
-SAL_WARN_IF(bRefIsValid  i-nStart = i-nEnd, editeng,
+SAL_WARN_IF(bRefIsValid  rWrong.nStart = rWrong.nEnd, editeng,
 TextInserted, WrongRange: Start = End?!);
 (void)bRefIsValid;
 }
commit aa274d8f587afa9e876334a1b6303bcec0a9
Author: Michael Stahl mst...@redhat.com
Date:   Fri Feb 3 13:34:07 2012 +0100

editeng: convert some DBG_ASSERTs

diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index 77a65dd..f13fb1a 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -55,7 +55,7 @@ EditSpellWrapper::EditSpellWrapper( Window* _pWin,
 sal_Bool bIsStart, sal_Bool bIsAllRight, EditView* pView ) :
 SvxSpellWrapper( _pWin, xChecker, bIsStart, bIsAllRight )
 {
-DBG_ASSERT( pView, One view has to be abandoned! );
+SAL_WARN_IF( !pView, editeng, One view has to be abandoned! );
 // Keep IgnoreList, delete ReplaceList...
 if (SvxGetChangeAllList().is())
 SvxGetChangeAllList()-clear();
@@ -283,11 +283,12 @@ void WrongList::TextInserted( sal_uInt16 nPos, sal_uInt16 
nNew, sal_Bool bPosIsS
 ++(i-nStart);
 }
 }
-DBG_ASSERT(!bRefIsValid || i-nStart  i-nEnd, TextInserted, 
WrongRange: Start = End?!);
+SAL_WARN_IF(bRefIsValid  i-nStart = i-nEnd, editeng,
+TextInserted, WrongRange: Start = End?!);
 (void)bRefIsValid;
 }
 
-DBG_ASSERT( !DbgIsBuggy(), InsertWrong: WrongList broken! );
+SAL_WARN_IF(DbgIsBuggy(), editeng, InsertWrong: WrongList broken!);
 }
 
 void WrongList::TextDeleted( sal_uInt16 nPos, sal_uInt16 nDeleted )
@@ -343,7 +344,8 @@ void WrongList::TextDeleted( sal_uInt16 nPos, sal_uInt16 

[Libreoffice-commits] .: 2 commits - editeng/source svtools/source

2012-01-31 Thread Caolán McNamara
 editeng/source/rtf/rtfgrf.cxx|2 +-
 svtools/source/filter/wmf/winwmf.cxx |2 +-
 svtools/source/filter/wmf/wmfwr.cxx  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 6b6bbe539bf4c72773b280addc7150656f83713b
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jan 31 20:23:25 2012 +

SWAPLONG-OSL_SWAPDWORD

diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx
index f22a0a4..142b48d 100644
--- a/editeng/source/rtf/rtfgrf.cxx
+++ b/editeng/source/rtf/rtfgrf.cxx
@@ -164,7 +164,7 @@ static sal_uInt8 aPal8[ 256 * 4 ] =
 inline long SwapLong( long n )
 {
 #ifndef OSL_LITENDIAN
-return SWAPLONG( n );
+return OSL_SWAPDWORD( n );
 #else
 return n;
 #endif
commit 19f53f40039a935fee48fdf1fb1f801f489fd478
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jan 31 20:21:22 2012 +

SWAPLONG-OSL_SWAPDWORD

diff --git a/svtools/source/filter/wmf/winwmf.cxx 
b/svtools/source/filter/wmf/winwmf.cxx
index c6e76d7..214dd57 100644
--- a/svtools/source/filter/wmf/winwmf.cxx
+++ b/svtools/source/filter/wmf/winwmf.cxx
@@ -875,7 +875,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
 if ( nEscLen = ( nRecSize * 2 ) )
 {
 #ifdef OSL_BIGENDIAN
-sal_uInt32 nTmp = SWAPLONG( nEsc );
+sal_uInt32 nTmp = OSL_SWAPDWORD( nEsc );
 sal_uInt32 nCheckSum = rtl_crc32( 0, nTmp, 4 
);
 #else
 sal_uInt32 nCheckSum = rtl_crc32( 0, nEsc, 4 
);
diff --git a/svtools/source/filter/wmf/wmfwr.cxx 
b/svtools/source/filter/wmf/wmfwr.cxx
index 2079154..ca0caad 100644
--- a/svtools/source/filter/wmf/wmfwr.cxx
+++ b/svtools/source/filter/wmf/wmfwr.cxx
@@ -523,7 +523,7 @@ bool IsStarSymbol(const String rStr)
 void WMFWriter::WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const 
sal_Int8* pData )
 {
 #ifdef OSL_BIGENDIAN
-sal_uInt32 nTmp = SWAPLONG( nEsc );
+sal_uInt32 nTmp = OSL_SWAPDWORD( nEsc );
 sal_uInt32 nCheckSum = rtl_crc32( 0, nTmp, 4 );
 #else
 sal_uInt32 nCheckSum = rtl_crc32( 0, nEsc, 4 );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - editeng/source svl/source

2012-01-05 Thread Christina Rossmanith
 editeng/source/editeng/impedit3.cxx |7 ---
 svl/source/memtools/svarray.cxx |1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 764040ac4e931e3460d0bd78906a7e624c994223
Author: Christina Rossmanith chrrossman...@web.de
Date:   Tue Nov 8 15:09:12 2011 +0100

removed unused #define_SVSTDARR_sal_uI(n)t16S(SORT)

diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index 5d92043..ee37bdf 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -35,7 +35,6 @@
 #define _SVSTDARR_STRINGSSORTDTOR
 #define _SVSTDARR_STRINGSISORT
 #define _SVSTDARR_STRINGSISORTDTOR
-#define _SVSTDARR_sal_uInt16SSORT
 
 #define _SVSTDARR_BYTESTRINGS
 #define _SVSTDARR_BYTESTRINGSDTOR
commit 62d86ff5501a924528b9b2794b18af16b3ddcbf0
Author: Christina Rossmanith chrrossman...@web.de
Date:   Tue Nov 8 08:42:27 2011 +0100

Remove Fill() usage

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 9c2a800..c964aeb 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -77,6 +77,8 @@
 #include i18npool/mslangid.hxx
 
 #include comphelper/processfactory.hxx
+#include rtl/ustrbuf.hxx
+#include comphelper/string.hxx
 
 using ::rtl::OUString;
 using namespace ::com::sun::star;
@@ -3289,12 +3291,11 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, 
Rectangle aClipRec, Point aSta
 aTmpFont.SetEscapement( 0 );
 aTmpFont.SetPropr( 100 );
 aTmpFont.SetPhysFont( pOutDev 
);
-String aBlanks;
-aBlanks.Fill( nTextLen, ' ' );
+rtl::OUStringBuffer aBlanks = 
comphelper::string::padToLength( aBlanks, (sal_Int32) nTextLen, ' ' );
 Point aUnderlinePos( aOutPos );
 if ( nOrientation )
 aUnderlinePos = 
lcl_ImplCalcRotatedPos( aTmpPos, aOrigin, nSin, nCos );
-pOutDev-DrawStretchText( 
aUnderlinePos, aSz.Width(), aBlanks, 0, nTextLen );
+pOutDev-DrawStretchText( 
aUnderlinePos, aSz.Width(), aBlanks.makeStringAndClear(), 0, nTextLen );
 
 aTmpFont.SetUnderline( 
UNDERLINE_NONE );
 if ( !nOrientation )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits