Re: [Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-02 Thread Marcel Metz
Hello Julien

On 02/01/2012 11:40 PM, julien2412 wrote:
 Here are the lines :
  961 // dann mal die Tabellenkoepfe raus:
  962 for( SwSelBoxes::iterator it = rBoxes.begin(); it !=
 rBoxes.end(); ++it )
  963 {
  964 pLine = it-second-GetUpper();
  965 while( pLine-GetUpper() )
  966 pLine = pLine-GetUpper()-GetUpper();
  967
  968 if( pTbl-IsHeadline( *pLine ) )
  969 {
  970 rBoxes.erase( it++ );
  971 --it;
  972 }
  973 }

If the box that is represented by `it` should be deleted you could use.

970  it = rBoxes.erase( it );

`it` would now point to the element after the erased one. This is true
for every sequence in the standard template library (see [1] under
Expression semantics - Erase post condition).

[1] http://www.sgi.com/tech/stl/Sequence.html

regards Marcel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH][PUSHED] Replace ENSURE_OR_* macros with regular code.

2012-01-24 Thread Marcel Metz
Hello Stephan,

On 24.01.2012 09:30, Stephan Bergmann wrote:
 However, I have another question:  I notice that, while most
 occurrences  are replaced with SAL_WARN, some were left as OSL_ENSURE
 (which I changed to SAL_WARN; one missed a comma, anyway) and some
 are changed to SAL_INFO.  Was there some rationale for that?

No, unfortunately none aside from my sloppiness. Even after reviewing it
twice it does seem like I don't get it right. :/
Thanks for your review Stephan.

regards Marcel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH] Replace ENSURE_OR_* macros with regular code.

2012-01-23 Thread Marcel Metz
Hello Muthu,

On 23.01.2012 09:19, Muthu Subramanian K wrote:
 Before pushing, it would be great to understand the reason behind
 replacing the macro with regular code.

Sure thing. The reason why I replaced the ENSURE_OR_* macros with
regular code was the replacement of the OSL_ENSURE macro with SAL_WARN.
SAL_WARN needs a location parameter that could be added to the macros
parameter list. But the macros lump together debugging code and code
that is independent of the debug compilation and part of the regular
application execution (even if in some places this is only avoiding some
invalid application state).
I don't have enough understanding of the code yet to think of a better
replacement of macros where this would be applicable (exceptions,
rewrite the code in a way that the condition can't occur anymore) so
I've decided for now to drop the macros in favor of regular code.

 I believe the macro would help in improving code readability (and
 of course the code size) - in my understanding. Any particular
 reason, please?

I oppose to the macros improve readability argument, these macros
don't improve readability, they hide some regular execution from the
programmer. You would need to know the structure of the macro to
completely understand what the code is doing which could be a problem
for developers that are not aware of the side effects of the macros.
When reading the regular code the keywords that change the execution
would stand out while the macros could easily be skipped.

The code size shouldn't matter because after the preprocessor run the
output is exactly the same and I prefer code clarity over source code size.

regards Marcel Metz


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Replace ENSURE_OR_* macros with regular code.

2012-01-22 Thread Marcel Metz
Hello lo-devs,

the attached patches replace some of the ENSURE_OR_* macros, with
regular code. I can't see any advantage in these macros aside from save
some typing.

regards Marcel Metz
From 1d0aeb0f7266646da553ea7d120afcc9065118e5 Mon Sep 17 00:00:00 2001
Message-Id: 1d0aeb0f7266646da553ea7d120afcc9065118e5.1327236163.git.mm...@adrian-broher.net
From: Marcel Metz mm...@adrian-broher.net
Date: Sun, 15 Jan 2012 11:30:24 +0100
Subject: [PATCH 1/2] Replaced diagnore ENSURE_OR_BREAK with regular code.
To: libreoffice@lists.freedesktop.org
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=true

This is a multi-part message in MIME format.
--true
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
 basctl/source/basicide/basobj2.cxx |   18 +++--
 svtools/source/contnr/svtreebx.cxx |7 -
 svtools/source/uno/svtxgridcontrol.cxx |   42 +++
 svx/source/form/fmpgeimp.cxx   |6 -
 ucb/source/ucp/ext/ucpext_content.cxx  |   21 +--
 xmloff/source/forms/elementimport.cxx  |   42 +--
 6 files changed, 114 insertions(+), 22 deletions(-)


--true
Content-Type: text/x-patch; name=0001-Replaced-diagnore-ENSURE_OR_BREAK-with-regular-code.patch
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename=0001-Replaced-diagnore-ENSURE_OR_BREAK-with-regular-code.patch

diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 646c40c..36ee590 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -305,13 +305,25 @@ namespace
 break;
 
 SbModule* pModule = pMethod-GetModule();
-ENSURE_OR_BREAK( pModule, BasicIDE::ChooseMacro: No Module found! );
+if ( !pModule )
+{
+SAL_WARN( basctl.basicide, BasicIDE::ChooseMacro: No Module found! );
+break;
+}
 
 StarBASIC* pBasic = dynamic_castStarBASIC*(pModule-GetParent());
-ENSURE_OR_BREAK( pBasic, BasicIDE::ChooseMacro: No Basic found! );
+if ( !pBasic )
+{
+SAL_WARN( basctl.basicide, BasicIDE::ChooseMacro: No Basic found! );
+break;
+}
 
 BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic );
-ENSURE_OR_BREAK( pBasMgr, BasicIDE::ChooseMacro: No BasicManager found! );
+if ( !pBasMgr )
+{
+SAL_WARN( basctl.basicide, BasicIDE::ChooseMacro: No BasicManager found! );
+break;
+}
 
 // name
 String aName;
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index 5fa9bde..9bcbeb9 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -2209,7 +2209,12 @@ void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry
 case LISTACTION_INSERTED:
 {
 SvLBoxEntry* pEntry( dynamic_cast SvLBoxEntry* ( pEntry1 ) );
-ENSURE_OR_BREAK( pEntry, SvTreeListBox::ModelNotification: invalid entry! );
+if ( !pEntry )
+{
+SAL_WARN( svtools.contnr, SvTreeListBox::ModelNotification: invalid entry! );
+break;
+}
+
 SvLBoxContextBmp* pBmpItem = static_cast SvLBoxContextBmp* ( pEntry-GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ) );
 if ( !pBmpItem )
 break;
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index c6ce75f..2452c15 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -152,7 +152,12 @@ void SVTXGridControl::setProperty( const ::rtl::OUString PropertyName, const An
 {
 sal_Int32 rowHeaderWidth( -1 );
 aValue = rowHeaderWidth;
-ENSURE_OR_BREAK( rowHeaderWidth  0, SVTXGridControl::setProperty: illegal row header width! );
+if ( rowHeaderWidth = 0 )
+{
+SAL_WARN( svtools.uno, SVTXGridControl::setProperty: illegal row header width! );
+break;
+}
+
 m_pTableModel-setRowHeaderWidth( rowHeaderWidth );
 // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
 pTable-Invalidate();
@@ -170,7 +175,12 @@ void SVTXGridControl::setProperty( const ::rtl::OUString PropertyName, const An
 {
 aValue = columnHeaderHeight;
 }
-ENSURE_OR_BREAK( columnHeaderHeight  0, SVTXGridControl::setProperty: illegal column header height! );
+if ( columnHeaderHeight = 0 )
+{
+SAL_WARN( svtools.uno, SVTXGridControl::setProperty: illegal column header width

[Libreoffice] [PATCH core] Remove cruft in debug tools.

2012-01-09 Thread Marcel Metz
Hello lo-devs,

the define SV_MEMMGR in tools/source/debug/debug.cxx was commented
out since 2001 and all of the memory related debugging code
depends on this define. These patches removes all of the depending
code. The ini configuration reader and writer for the debugging
configuration now simply ignore the memory block.

regards

Marcel Metz

---
 sfx2/source/appl/appopen.cxx |6 -
 sfx2/source/appl/appserv.cxx |4 -
 sfx2/source/bastyp/bitset.cxx|   14 ---
 sfx2/source/bastyp/minarray.cxx  |9 --
 sfx2/source/control/bindings.cxx |   22 
 sfx2/source/control/ctrlitem.cxx |   15 ---
 sfx2/source/control/dispatch.cxx |   13 ---
 sfx2/source/control/msgpool.cxx  |7 --
 sfx2/source/control/objface.cxx  |4 -
 sfx2/source/control/request.cxx  |   13 ---
 sfx2/source/control/statcach.cxx |6 -
 sfx2/source/menu/mnuitem.cxx |8 --
 sfx2/source/menu/mnumgr.cxx  |5 -
 sfx2/source/menu/virtmenu.cxx|   13 ---
 sfx2/source/notify/hintpost.cxx  |3 -
 sfx2/source/statbar/stbitem.cxx  |1 -
 sfx2/source/toolbox/tbxitem.cxx  |1 -
 sfx2/source/view/viewfrm.cxx |3 -
 tools/inc/tools/debug.hxx|   36 +--
 tools/source/debug/debug.cxx |   75 +-
 vcl/source/app/dbggui.cxx|  220
+-
 21 files changed, 6 insertions(+), 472 deletions(-)


diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index ebb9749..e60c108 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -530,8 +530,6 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock xDoc, const String
 
 void SfxApplication::NewDocDirectExec_Impl( SfxRequest rReq )
 {
-DBG_MEMTEST();
-
 SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, sal_False);
 String aFactName;
 if ( pFactoryItem )
@@ -565,8 +563,6 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest rReq )
 
 void SfxApplication::NewDocExec_Impl( SfxRequest rReq )
 {
-DBG_MEMTEST();
-
 // No Parameter from BASIC only Factory given?
 SFX_REQUEST_ARG(rReq, pTemplNameItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False);
 SFX_REQUEST_ARG(rReq, pTemplFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False);
@@ -696,8 +692,6 @@ bool lcl_isFilterNativelySupported(const SfxFilter rFilter)
 
 void SfxApplication::OpenDocExec_Impl( SfxRequest rReq )
 {
-DBG_MEMTEST();
-
 sal_uInt16 nSID = rReq.GetSlot();
 SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
 if ( pFileNameItem )
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index f6eb9ca..3ac3122 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -182,7 +182,6 @@ static void showDocument( const char* pBaseName )
 
 void SfxApplication::MiscExec_Impl( SfxRequest rReq )
 {
-DBG_MEMTEST();
 bool bDone = false;
 switch ( rReq.GetSlot() )
 {
@@ -616,8 +615,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest rReq )
 
 void SfxApplication::MiscState_Impl(SfxItemSet rSet)
 {
-DBG_MEMTEST();
-
 LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
 const sal_uInt16 *pRanges = rSet.GetRanges();
 DBG_ASSERT(pRanges  *pRanges, Set without range);
@@ -886,7 +883,6 @@ static ::rtl::OUString getConfigurationStringValue(
 
 void SfxApplication::OfaExec_Impl( SfxRequest rReq )
 {
-DBG_MEMTEST();
 switch ( rReq.GetSlot() )
 {
 case SID_OPTIONS_TREEDIALOG:
diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx
index 3c7bf60..1b5e750 100644
--- a/sfx2/source/bastyp/bitset.cxx
+++ b/sfx2/source/bastyp/bitset.cxx
@@ -38,7 +38,6 @@
 
 BitSet BitSet::operator( sal_uInt16 nOffset ) const
 {
-DBG_MEMTEST();
 // create a work-copy, return it if nothing to shift
 BitSet aSet(*this);
 if ( nOffset == 0 )
@@ -89,7 +88,6 @@ BitSet BitSet::operator( sal_uInt16 nOffset ) const
 
 BitSet BitSet::operator( sal_uInt16 ) const
 {
-DBG_MEMTEST();
 return BitSet();
 }
 
@@ -99,12 +97,10 @@ BitSet BitSet::operator( sal_uInt16 ) const
 
 void BitSet::CopyFrom( const BitSet rSet )
 {
-DBG_MEMTEST();
 nCount = rSet.nCount;
 nBlocks = rSet.nBlocks;
 if ( rSet.nBlocks )
 {
-DBG_MEMTEST();
 pBitmap = new sal_uIntPtr[nBlocks];
 memcpy( pBitmap, rSet.pBitmap, 4 * nBlocks );
 }
@@ -118,7 +114,6 @@ void BitSet::CopyFrom( const BitSet rSet )
 
 BitSet::BitSet()
 {
-DBG_MEMTEST();
 nCount = 0;
 nBlocks = 0;
 pBitmap = 0;
@@ -130,7 +125,6 @@ BitSet::BitSet()
 
 BitSet::BitSet( const BitSet rOrig )
 {
-DBG_MEMTEST();
 CopyFrom(rOrig);
 }
 
@@ -140,7 +134,6 @@ BitSet::BitSet( const BitSet rOrig )
 
 BitSet::~BitSet()
 {
-DBG_MEMTEST();
 delete [] pBitmap;
 }
 
@@ -150,7 +143,6 @@ BitSet::~BitSet()
 
 BitSet BitSet::operator=( const BitSet rOrig

[Libreoffice] [PATCH binfilter] Remove cruft in debug tools.

2012-01-09 Thread Marcel Metz
---
 binfilter/bf_sfx2/source/bastyp/sfx2_bitset.cxx   |   10 --
 binfilter/bf_sfx2/source/bastyp/sfx2_minarray.cxx |6 --
 2 files changed, 0 insertions(+), 16 deletions(-)


diff --git a/binfilter/bf_sfx2/source/bastyp/sfx2_bitset.cxx b/binfilter/bf_sfx2/source/bastyp/sfx2_bitset.cxx
index 9fcdce7..042eaa3 100644
--- a/binfilter/bf_sfx2/source/bastyp/sfx2_bitset.cxx
+++ b/binfilter/bf_sfx2/source/bastyp/sfx2_bitset.cxx
@@ -26,7 +26,6 @@
  *
  /
 
-#include tools/debug.hxx
 #ifdef _MSC_VER
 #pragma hdrstop
 #endif
@@ -42,7 +41,6 @@ namespace binfilter {
 
 /*N*/ BitSet BitSet::operator( USHORT nOffset ) const
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   // create a work-copy, return it if nothing to shift
 /*N*/   BitSet aSet(*this);
 /*N*/   if ( nOffset == 0 )
@@ -97,12 +95,10 @@ namespace binfilter {
 
 /*N*/ void BitSet::CopyFrom( const BitSet rSet )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   nCount = rSet.nCount;
 /*N*/   nBlocks = rSet.nBlocks;
 /*N*/   if ( rSet.nBlocks )
 /*N*/   {
-/*N*/   DBG_MEMTEST();
 /*N*/   pBitmap = new ULONG[nBlocks];
 /*N*/   memcpy( pBitmap, rSet.pBitmap, 4 * nBlocks );
 /*N*/   }
@@ -116,7 +112,6 @@ namespace binfilter {
 
 /*N*/ BitSet::BitSet()
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   nCount = 0;
 /*N*/   nBlocks = 0;
 /*N*/   pBitmap = 0;
@@ -128,7 +123,6 @@ namespace binfilter {
 
 /*N*/ BitSet::BitSet( const BitSet rOrig )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   CopyFrom(rOrig);
 /*N*/ }
 
@@ -143,7 +137,6 @@ namespace binfilter {
 
 /*N*/ BitSet::~BitSet()
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/ delete [] pBitmap;
 /*N*/ }
 
@@ -168,7 +161,6 @@ namespace binfilter {
 
 /*N*/ BitSet BitSet::operator-=(USHORT nBit)
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   USHORT nBlock = nBit / 32;
 /*N*/   ULONG nBitVal = 1L  (nBit % 32);
 /*N*/
@@ -190,7 +182,6 @@ namespace binfilter {
 
 /*N*/ BitSet BitSet::operator|=( const BitSet rSet )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   USHORT nMax = Min(nBlocks, rSet.nBlocks);
 /*N*/
 /*N*/   // expand the bitmap
@@ -227,7 +218,6 @@ namespace binfilter {
 
 /*N*/ BitSet BitSet::operator|=( USHORT nBit )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   USHORT nBlock = nBit / 32;
 /*N*/   ULONG nBitVal = 1L  (nBit % 32);
 /*N*/
diff --git a/binfilter/bf_sfx2/source/bastyp/sfx2_minarray.cxx b/binfilter/bf_sfx2/source/bastyp/sfx2_minarray.cxx
index bb2a1e5..366d692 100644
--- a/binfilter/bf_sfx2/source/bastyp/sfx2_minarray.cxx
+++ b/binfilter/bf_sfx2/source/bastyp/sfx2_minarray.cxx
@@ -40,7 +40,6 @@ namespace binfilter {
 /*N*/   nGrow( nGrowSize ? nGrowSize : 1 ),
 /*N*/   nUnused( nInitSize )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   USHORT nMSCBug = nInitSize;
 /*N*/
 /*N*/   if ( nMSCBug  0 )
@@ -53,7 +52,6 @@ namespace binfilter {
 
 /*N*/ SfxPtrArr::SfxPtrArr( const SfxPtrArr rOrig )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   nUsed = rOrig.nUsed;
 /*N*/   nGrow = rOrig.nGrow;
 /*N*/   nUnused = rOrig.nUnused;
@@ -71,7 +69,6 @@ namespace binfilter {
 
 /*N*/ SfxPtrArr::~SfxPtrArr()
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   delete [] pData;
 /*N*/ }
 
@@ -79,7 +76,6 @@ namespace binfilter {
 
 /*N*/ USHORT SfxPtrArr::Remove( USHORT nPos, USHORT nLen )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird
 /*N*/   nLen = Min( (USHORT)(nUsed-nPos), nLen );
 /*N*/
@@ -133,7 +129,6 @@ namespace binfilter {
 
 /*N*/ BOOL SfxPtrArr::Remove( void* aElem )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   // einfache Aufgaben ...
 /*N*/   if ( nUsed == 0 )
 /*N*/   return FALSE;
@@ -153,7 +148,6 @@ namespace binfilter {
 
 /*N*/ void SfxPtrArr::Insert( USHORT nPos, void* rElem )
 /*N*/ {
-/*N*/   DBG_MEMTEST();
 /*N*/   DBG_ASSERT( sal_Int32(nUsed+1)  sal_Int32( USHRT_MAX / sizeof(void*) ), array too large );
 /*N*/   // musz das Array umkopiert werden?
 /*N*/   if ( nUnused == 0 )

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Replace Table with std::set.

2012-01-07 Thread Marcel Metz
Hello lo-devs,

this patch removes another use of the tools Table class.

regards

Marcel Metz

---
 vcl/source/control/combobox.cxx |   21 +++--
 1 files changed, 7 insertions(+), 14 deletions(-)


diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 584e493..97abfc1 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -27,6 +27,7 @@
  /
 
 
+#include set
 #include comphelper/string.hxx
 #include tools/table.hxx
 #include tools/debug.hxx
@@ -44,15 +45,7 @@
 
 // ===
 
-inline sal_uLong ImplCreateKey( sal_uInt16 nPos )
-{
-// Key = Pos+1, wegen Pos 0
-return nPos+1;
-}
-
-// ---
-
-static void lcl_GetSelectedEntries( Table rSelectedPos, const XubString rText, xub_Unicode cTokenSep, const ImplEntryList* pEntryList )
+static void lcl_GetSelectedEntries( ::std::set sal_uInt16  rSelectedPos, const XubString rText, xub_Unicode cTokenSep, const ImplEntryList* pEntryList )
 {
 for (xub_StrLen n = comphelper::string::getTokenCount(rText, cTokenSep); n;)
 {
@@ -60,7 +53,7 @@ static void lcl_GetSelectedEntries( Table rSelectedPos, const XubString rText,
 aToken = comphelper::string::strip(aToken, ' ');
 sal_uInt16 nPos = pEntryList-FindEntry( aToken );
 if ( nPos != LISTBOX_ENTRY_NOTFOUND )
-rSelectedPos.Insert( ImplCreateKey( nPos ), (void*)sal_IntPtr(1L) );
+rSelectedPos.insert( nPos );
 }
 }
 
@@ -417,13 +410,13 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
 }
 
 // Fehlende Eintraege anhaengen...
-Table aSelInText;
+::std::set sal_uInt16  aSelInText;
 lcl_GetSelectedEntries( aSelInText, aText, mcMultiSep, mpImplLB-GetEntryList() );
 sal_uInt16 nSelectedEntries = mpImplLB-GetEntryList()-GetSelectEntryCount();
 for ( sal_uInt16 n = 0; n  nSelectedEntries; n++ )
 {
 sal_uInt16 nP = mpImplLB-GetEntryList()-GetSelectEntryPos( n );
-if ( !aSelInText.IsKeyValid( ImplCreateKey( nP ) ) )
+if ( !aSelInText.count( nP ) )
 {
 if ( aText.Len()  (aText.GetChar( aText.Len()-1 ) != mcMultiSep) )
 aText += mcMultiSep;
@@ -952,10 +945,10 @@ void ComboBox::ImplUpdateFloatSelection()
 }
 else
 {
-Table aSelInText;
+::std::set sal_uInt16  aSelInText;
 lcl_GetSelectedEntries( aSelInText, mpSubEdit-GetText(), mcMultiSep, mpImplLB-GetEntryList() );
 for ( sal_uInt16 n = 0; n  mpImplLB-GetEntryList()-GetEntryCount(); n++ )
-mpImplLB-SelectEntry( n, aSelInText.IsKeyValid( ImplCreateKey( n ) ) );
+mpImplLB-SelectEntry( n, aSelInText.count( n ) );
 }
 mpImplLB-SetCallSelectionChangedHdl( sal_True );
 }

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 2/3] Removed unnecessary tools/ref.hxx includes.

2012-01-06 Thread Marcel Metz
---
 cui/source/dialogs/SpellDialog.cxx |1 -
 cui/source/dialogs/cuitbxform.cxx  |1 -
 cui/source/dialogs/dlgname.cxx |1 -
 cui/source/tabpages/tabarea.cxx|1 -
 fileaccess/source/FileAccess.cxx   |1 -
 sc/source/ui/view/tabview5.cxx |1 -
 sd/source/ui/dlg/dlgctrls.cxx  |1 -
 sd/source/ui/inc/sdpreslt.hxx  |1 +
 sd/source/ui/view/sdview2.cxx  |1 -
 sfx2/inc/sfx2/fcontnr.hxx  |2 ++
 sfx2/inc/sfx2/ipclient.hxx |1 -
 sfx2/source/bastyp/helper.cxx  |1 -
 svtools/inc/svtools/ivctrl.hxx |1 +
 svtools/inc/svtools/svlbox.hxx |1 +
 svtools/source/control/valueset.cxx|1 +
 svtools/source/filter/exportdialog.cxx |1 -
 svtools/source/uno/treecontrolpeer.hxx |1 +
 svx/inc/svdibrow.hxx   |1 +
 svx/source/dialog/relfld.cxx   |1 -
 svx/source/form/tbxform.cxx|1 -
 svx/source/tbxctrls/tbxdrctl.cxx   |1 -
 sw/source/core/frmedt/fedesc.cxx   |2 --
 sw/source/filter/basflt/docfact.cxx|1 -
 sw/source/filter/xml/xmlexpit.hxx  |1 -
 sw/source/filter/xml/xmlimpit.hxx  |1 -
 sw/source/ui/docvw/edtwin2.cxx |1 -
 sw/source/ui/misc/pgfnote.cxx  |1 -
 tools/inc/tools/resmgr.hxx |1 -
 vcl/inc/unx/salstd.hxx |1 -
 vcl/source/gdi/outdev.cxx  |1 -
 vcl/source/gdi/outdev5.cxx |1 -
 vcl/source/gdi/salgdilayout.cxx|1 -
 vcl/source/window/seleng.cxx   |1 -
 vcl/source/window/tabpage.cxx  |1 -
 34 files changed, 8 insertions(+), 28 deletions(-)


diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 58e0be9..2f66b41 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -28,7 +28,6 @@
 
 // include ---
 
-#include tools/ref.hxx
 #include tools/shl.hxx
 #include vcl/wrkwin.hxx
 #include vcl/menu.hxx
diff --git a/cui/source/dialogs/cuitbxform.cxx b/cui/source/dialogs/cuitbxform.cxx
index 2e14b97..9a293f5 100644
--- a/cui/source/dialogs/cuitbxform.cxx
+++ b/cui/source/dialogs/cuitbxform.cxx
@@ -27,7 +27,6 @@
  /
 
 #include string
-#include tools/ref.hxx
 #include tools/shl.hxx
 #include svl/intitem.hxx
 #include svl/eitem.hxx
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 78cef10..89ea202 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -26,7 +26,6 @@
  *
  /
 
-#include tools/ref.hxx
 #include tools/shl.hxx
 #include tools/debug.hxx
 #include vcl/msgbox.hxx
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index 497af51..4814f15 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -26,7 +26,6 @@
  *
  /
 
-#include tools/ref.hxx
 #include sfx2/app.hxx
 #include sfx2/objsh.hxx
 #include vcl/msgbox.hxx
diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx
index 5852183..20798a3 100644
--- a/fileaccess/source/FileAccess.cxx
+++ b/fileaccess/source/FileAccess.cxx
@@ -34,7 +34,6 @@
 #include cppuhelper/factory.hxx
 #include cppuhelper/implbase1.hxx
 
-#include tools/ref.hxx
 #include tools/urlobj.hxx
 #include ucbhelper/content.hxx
 #include unotools/streamwrap.hxx
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index bd1a979..ca274c7 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -41,7 +41,6 @@
 #include sfx2/bindings.hxx
 #include sfx2/dispatch.hxx
 #include sfx2/objsh.hxx
-#include tools/ref.hxx
 
 #include tabview.hxx
 #include tabvwsh.hxx
diff --git a/sd/source/ui/dlg/dlgctrls.cxx b/sd/source/ui/dlg/dlgctrls.cxx
index fde687e..9202c18 100644
--- a/sd/source/ui/dlg/dlgctrls.cxx
+++ b/sd/source/ui/dlg/dlgctrls.cxx
@@ -27,7 +27,6 @@
  /
 
 
-#include tools/ref.hxx
 #include tools/debug.hxx
 
 #include strings.hrc
diff --git a/sd/source/ui/inc/sdpreslt.hxx b/sd/source/ui/inc/sdpreslt.hxx
index 95b89bb..d0a62d5 100644
--- a/sd/source/ui/inc/sdpreslt.hxx
+++ b/sd/source/ui/inc/sdpreslt.hxx
@@ -32,6 +32,7 @@
 #include vcl/dialog.hxx
 #include vcl/button.hxx
 #include vcl/fixed.hxx
+#include tools/list.hxx
 #include svtools/valueset.hxx
 
 class SfxItemSet;
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index bd3a8d6..f01e5c9 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -32,7 +32,6 @@
 
 #include vector
 #include com/sun/star/embed/XEmbedPersist.hpp
-#include 

[Libreoffice] [PATCH 1/2] Removed unnecessary tools/link.hxx includes.

2012-01-06 Thread Marcel Metz
---
 binfilter/bf_so3/source/solink/impldde.hxx |1 +
 binfilter/inc/bf_basic/sbstar.hxx  |1 +
 binfilter/inc/bf_sc/cellsuno.hxx   |1 +
 binfilter/inc/bf_sw/crsrsh.hxx |1 +
 4 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/binfilter/bf_so3/source/solink/impldde.hxx b/binfilter/bf_so3/source/solink/impldde.hxx
index f050eca..3a9b714 100644
--- a/binfilter/bf_so3/source/solink/impldde.hxx
+++ b/binfilter/bf_so3/source/solink/impldde.hxx
@@ -29,6 +29,7 @@
 #define _IMPLDDE_HXX
 
 #include bf_so3/linksrc.hxx
+#include tools/link.hxx
 #include tools/string.hxx
 
 namespace binfilter
diff --git a/binfilter/inc/bf_basic/sbstar.hxx b/binfilter/inc/bf_basic/sbstar.hxx
index 0113ab4..fbdea26 100644
--- a/binfilter/inc/bf_basic/sbstar.hxx
+++ b/binfilter/inc/bf_basic/sbstar.hxx
@@ -33,6 +33,7 @@
 
 #include sbx.hxx
 #include bf_basic/sbxobj.hxx
+#include tools/link.hxx
 #include rtl/ustring.hxx
 #include osl/mutex.hxx
 
diff --git a/binfilter/inc/bf_sc/cellsuno.hxx b/binfilter/inc/bf_sc/cellsuno.hxx
index d14593b..cc78428 100644
--- a/binfilter/inc/bf_sc/cellsuno.hxx
+++ b/binfilter/inc/bf_sc/cellsuno.hxx
@@ -89,6 +89,7 @@
 #include cppuhelper/implbase2.hxx
 #include cppuhelper/implbase3.hxx
 
+#include tools/link.hxx
 #include vector
 namespace binfilter {
 
diff --git a/binfilter/inc/bf_sw/crsrsh.hxx b/binfilter/inc/bf_sw/crsrsh.hxx
index 8ede44a..fdd8756 100644
--- a/binfilter/inc/bf_sw/crsrsh.hxx
+++ b/binfilter/inc/bf_sw/crsrsh.hxx
@@ -30,6 +30,7 @@
 
 #include bf_svtools/bf_solar.h
 
+#include tools/link.hxx
 #include tools/string.hxx
 
 #include viewsh.hxx   // fuer ViewShell

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 2/2] Removed unnecessary tools/ref.hxx includes.

2012-01-06 Thread Marcel Metz
---
 binfilter/inc/bf_sfx2/fcontnr.hxx |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/binfilter/inc/bf_sfx2/fcontnr.hxx b/binfilter/inc/bf_sfx2/fcontnr.hxx
index 07f9c75..13d62fb 100644
--- a/binfilter/inc/bf_sfx2/fcontnr.hxx
+++ b/binfilter/inc/bf_sfx2/fcontnr.hxx
@@ -35,6 +35,7 @@
 
 #include bf_sfx2/docfilt.hxx
 #include bf_sfx2/sfxdefs.hxx
+#include tools/ref.hxx
 class Window;
 namespace binfilter {
 

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Remove unused tools function.

2012-01-03 Thread Marcel Metz
Hello lo-devs,

this patch removes the unused (according to OpenGrok) GetIsoFallback
function from the tools module.

regards Marcel

---
 rsc/source/parser/rscdb.cxx |1 -
 tools/Library_tl.mk |1 -
 tools/Package_inc.mk|1 -
 tools/inc/tools/isofallback.hxx |   40 --
 tools/source/rc/isofallback.cxx |   70
---
 tools/source/rc/resmgr.cxx  |2 -
 6 files changed, 0 insertions(+), 115 deletions(-)
 delete mode 100644 tools/inc/tools/isofallback.hxx
 delete mode 100644 tools/source/rc/isofallback.cxx


diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 2a36f69..3c8d93d 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -35,7 +35,6 @@
 
 #include tools/fsys.hxx
 #include tools/rc.h
-#include tools/isofallback.hxx
 #include rtl/strbuf.hxx
 #include sal/macros.h
 
diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk
index 8dc9215..30bf9fd 100644
--- a/tools/Library_tl.mk
+++ b/tools/Library_tl.mk
@@ -95,7 +95,6 @@ $(eval $(call gb_Library_add_exception_objects,tl,\
 tools/source/misc/extendapplicationenvironment \
 tools/source/misc/getprocessworkingdir \
 tools/source/misc/solarmutex \
-tools/source/rc/isofallback \
 tools/source/rc/rc \
 tools/source/rc/resary \
 tools/source/rc/resmgr \
diff --git a/tools/Package_inc.mk b/tools/Package_inc.mk
index c17aedd..91642c4 100644
--- a/tools/Package_inc.mk
+++ b/tools/Package_inc.mk
@@ -53,7 +53,6 @@ $(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetdef.hxx,tools/inetdef.
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetmime.hxx,tools/inetmime.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetmsg.hxx,tools/inetmsg.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetstrm.hxx,tools/inetstrm.hxx))
-$(eval $(call gb_Package_add_file,tools_inc,inc/tools/isofallback.hxx,tools/isofallback.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/line.hxx,tools/line.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/link.hxx,tools/link.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/list.hxx,tools/list.hxx))
diff --git a/tools/inc/tools/isofallback.hxx b/tools/inc/tools/isofallback.hxx
deleted file mode 100644
index 4a23462..000
--- a/tools/inc/tools/isofallback.hxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * http://www.openoffice.org/license.html
- * for a copy of the LGPLv3 License.
- *
- /
-
-#ifndef _ISOFALLBACK_HXX
-#define _ISOFALLBACK_HXX
-
-#include rtl/string.hxx
-#include tools/toolsdllapi.h
-
-// Return true if valid fallback found
-TOOLS_DLLPUBLIC bool GetIsoFallback(rtl::OString rLanguage);
-
-#endif //_ISOFALLBACK_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/rc/isofallback.cxx b/tools/source/rc/isofallback.cxx
deleted file mode 100644
index 3c134df..000
--- a/tools/source/rc/isofallback.cxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU 

[Libreoffice] [PATCH 1/5] Removed unnecessary tools includes.

2012-01-03 Thread Marcel Metz
Hello lo-devs,

this patch series removes a lot of unnecessary includes for the various
tools header. The patches without suffix should be applied to the core
repository, the .binfilter.patch suffix should be applied to the
binfilter repository. I've tested the build with the configuration
--enable-binfilter --enable-dbgutil --enable-debug, is this sufficient
or did I miss another important configuration, that enables some
conditional compiled code? I've only build this on linux-x86_64, but the
patch also touches some of the mac specific code like
fpicker/source/aqua/SalAquaFilePicker.mm so it would be maybe a good
idea to test this patch.


regards Marcel Metz

---
 basic/source/classes/sb.cxx|1 -
 chart2/source/view/axes/VAxisProperties.cxx|1 -
 chart2/source/view/diagram/VDiagram.cxx|1 -
 chart2/source/view/main/ShapeFactory.cxx   |1 -
 connectivity/source/drivers/calc/CTable.cxx|1 -
 connectivity/source/drivers/flat/ETable.cxx|1 -
 connectivity/workben/testmoz/main.cxx  |1 -
 connectivity/workben/testmoz/mozthread.cxx |1 -
 cui/source/dialogs/hldocntp.cxx|1 -
 cui/source/options/optpath.cxx |1 -
 dbaccess/source/ext/adabas/AdabasNewDb.cxx |1 -
 dbaccess/source/ui/browser/brwctrlr.cxx|1 -
 desktop/source/app/appfirststart.cxx   |1 -
 desktop/source/app/appinit.cxx |1 -
 desktop/source/migration/migration.cxx |1 -
 editeng/source/items/textitem.cxx  |1 -
 editeng/source/rtf/svxrtf.cxx  |1 -
 extensions/source/nsplugin/source/so_instance.cxx  |1 -
 extensions/source/scanner/sanedlg.hxx  |1 -
 filter/source/graphicfilter/eps/eps.cxx|1 -
 forms/source/component/ComboBox.hxx|2 --
 forms/source/component/EditBase.hxx|1 -
 forms/source/richtext/richtextvclcontrol.cxx   |3 ---
 framework/inc/jobs/jobdata.hxx |1 -
 framework/inc/uiconfiguration/imagemanager.hxx |3 ---
 .../inc/uiconfiguration/moduleimagemanager.hxx |3 ---
 framework/source/fwe/classes/addonsoptions.cxx |1 -
 framework/source/fwe/classes/bmkmenu.cxx   |1 -
 framework/source/services/sessionlistener.cxx  |1 -
 .../source/uiconfiguration/imagemanagerimpl.hxx|3 ---
 idl/source/cmptools/lex.cxx|1 -
 l10ntools/source/export2.cxx   |1 -
 padmin/source/adddlg.cxx   |1 +
 padmin/source/cmddlg.cxx   |1 +
 padmin/source/cmddlg.hxx   |1 -
 padmin/source/newppdlg.cxx |1 +
 padmin/source/padialog.hxx |1 -
 reportdesign/source/core/api/FixedText.cxx |1 +
 reportdesign/source/core/api/FormatCondition.cxx   |1 +
 reportdesign/source/core/api/FormattedField.cxx|1 +
 reportdesign/source/core/api/ImageControl.cxx  |1 +
 .../source/core/inc/ReportControlModel.hxx |1 -
 sc/source/core/inc/core_pch.hxx|1 -
 sc/source/filter/inc/biff.hxx  |1 -
 sc/source/filter/inc/excrecds.hxx  |1 -
 sc/source/filter/inc/filt_pch.hxx  |1 -
 sc/source/filter/inc/qpro.hxx  |1 -
 sc/source/filter/inc/qprostyle.hxx |1 -
 sc/source/filter/qpro/qprostyle.cxx|1 -
 .../ui/Accessibility/AccessibleContextBase.cxx |1 -
 sc/source/ui/inc/ui_pch.hxx|1 -
 sd/source/filter/eppt/eppt.cxx |1 -
 sd/source/filter/ppt/propread.cxx  |1 -
 sd/source/filter/ppt/propread.hxx  |1 -
 sd/source/ui/annotations/annotationwindow.hxx  |3 ---
 sd/source/ui/dlg/morphdlg.cxx  |1 -
 sd/source/ui/dlg/vectdlg.cxx   |1 -
 .../controls/RecentMasterPagesSelector.cxx |1 -
 sfx2/source/appl/app.cxx   |1 -
 sfx2/source/appl/appcfg.cxx|1 -
 sfx2/source/appl/appdata.cxx   |1 -
 sfx2/source/appl/appinit.cxx   |1 -
 sfx2/source/appl/appmain.cxx   |1 -
 sfx2/source/appl/appmisc.cxx   |1 -
 sfx2/source/appl/appserv.cxx   |1 -
 sfx2/source/appl/appuno.cxx|1 -
 sfx2/source/appl/newhelp.cxx   |1 -
 sfx2/source/bastyp/fltfnc.cxx  |1 -
 sfx2/source/doc/docfac.cxx |1 -
 sfx2/source/doc/docfile.cxx|1 -
 sfx2/source/doc/objcont.cxx

[Libreoffice] [PATCH 3/5] Removed unnecessary tools includes.

2012-01-03 Thread Marcel Metz
---
 cui/source/factory/cuiresmgr.cxx   |1 -
 cui/source/factory/dlgfact.cxx |1 -
 cui/source/inc/about.hxx   |1 -
 dbaccess/source/core/api/viewcontainer.cxx |1 -
 dbaccess/source/ui/inc/charsets.hxx|1 -
 dbaccess/source/ui/inc/imageprovider.hxx   |1 +
 desktop/source/app/userinstall.cxx |1 -
 .../deployment/gui/dp_gui_dependencydialog.cxx |1 -
 .../source/deployment/gui/dp_gui_updatedialog.cxx  |1 -
 .../deployment/gui/dp_gui_updateinstalldialog.cxx  |1 -
 desktop/source/deployment/inc/dp_resource.h|1 -
 desktop/source/deployment/misc/dp_resource.cxx |1 +
 editeng/inc/editeng/outliner.hxx   |1 +
 forms/source/richtext/richtextunowrapper.cxx   |1 +
 fpicker/source/aqua/SalAquaFilePicker.mm   |1 -
 fpicker/source/aqua/SalAquaFolderPicker.mm |2 --
 fpicker/source/office/iodlgimp.cxx |1 -
 framework/source/dispatch/menudispatcher.cxx   |1 -
 framework/source/services/backingcomp.cxx  |1 -
 sc/source/core/tool/compiler.cxx   |1 -
 sd/source/ui/dlg/sddlgfact.cxx |1 -
 sfx2/source/appl/appcfg.cxx|1 -
 sfx2/source/appl/appdata.cxx   |1 -
 sfx2/source/appl/appinit.cxx   |1 -
 sfx2/source/appl/appuno.cxx|1 -
 sfx2/source/config/evntconf.cxx|1 -
 sfx2/source/dialog/filtergrouping.cxx  |1 -
 sfx2/source/doc/doctempl.cxx   |1 -
 sfx2/source/doc/objxtor.cxx|1 -
 svtools/source/config/miscopt.cxx  |1 -
 svtools/source/contnr/contentenumeration.hxx   |1 +
 svtools/source/dialogs/insdlg.cxx  |1 -
 svtools/source/graphic/transformer.cxx |1 -
 svx/source/dialog/dialmgr.cxx  |1 -
 svx/source/form/fmobj.cxx  |1 -
 svx/source/inc/AccessibleFrameSelector.hxx |1 +
 sw/inc/ccoll.hxx   |1 -
 sw/source/ui/inc/swrenamexnameddlg.hxx |1 -
 sw/source/ui/inc/swuiccoll.hxx |1 +
 sw/source/ui/inc/swuicnttab.hxx|1 -
 tools/inc/tools/resary.hxx |3 ++-
 tools/source/fsys/wntmsc.cxx   |1 -
 tools/source/rc/resary.cxx |1 +
 unotools/source/config/defaultoptions.cxx  |1 -
 unotools/source/config/extendedsecurityoptions.cxx |1 -
 unotools/source/config/inetoptions.cxx |1 -
 unotools/source/config/pathoptions.cxx |1 -
 vcl/aqua/source/app/salsys.cxx |2 --
 vcl/inc/vcl/bitmap.hxx |2 +-
 vcl/inc/vcl/pdfwriter.hxx  |1 +
 vcl/ios/source/app/salsys.cxx  |2 --
 vcl/source/control/field.cxx   |1 -
 52 files changed, 12 insertions(+), 46 deletions(-)


diff --git a/cui/source/factory/cuiresmgr.cxx b/cui/source/factory/cuiresmgr.cxx
index 8e3bc31..20d41b3 100644
--- a/cui/source/factory/cuiresmgr.cxx
+++ b/cui/source/factory/cuiresmgr.cxx
@@ -29,7 +29,6 @@
 // include ---
 
 #include dialmgr.hxx
-#include tools/rc.hxx
 #include svl/solar.hrc
 #include vcl/svapp.hxx
 
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index dc7c368..55b2b72 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -29,7 +29,6 @@
 #include align.hxx //add for SvxAlignmentTabPage
 #include dlgfact.hxx
 
-#include tools/rc.hxx
 #include sfx2/basedlgs.hxx
 #include sfx2/app.hxx
 #include sfx2/request.hxx
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 4e09e0e..e7e5227 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -30,7 +30,6 @@
 
 // include ---
 
-#include tools/resary.hxx
 #include vcl/button.hxx
 #include vcl/accel.hxx
 #include svtools/svmedit.hxx
diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx
index 83badfb..4f004e1 100644
--- a/dbaccess/source/core/api/viewcontainer.cxx
+++ b/dbaccess/source/core/api/viewcontainer.cxx
@@ -34,7 +34,6 @@
 #include View.hxx
 
 #include tools/debug.hxx
-#include tools/wldcrd.hxx
 #include comphelper/enumhelper.hxx
 #include comphelper/types.hxx
 #include connectivity/dbtools.hxx
diff --git a/dbaccess/source/ui/inc/charsets.hxx b/dbaccess/source/ui/inc/charsets.hxx
index f5f5169..89fa3d4 100644
--- a/dbaccess/source/ui/inc/charsets.hxx
+++ b/dbaccess/source/ui/inc/charsets.hxx
@@ -30,7 +30,6 @@
 

[Libreoffice] [PATCH 4/5] Removed unnecessary tools includes.

2012-01-03 Thread Marcel Metz
---
 avmedia/source/gstreamer/gstcommon.hxx |1 -
 avmedia/source/quicktime/quicktimecommon.hxx   |1 -
 avmedia/source/win/wincommon.hxx   |1 -
 basic/source/sbx/sbxres.cxx|2 ++
 basic/source/sbx/sbxres.hxx|2 +-
 dbaccess/source/core/dataaccess/ModelImpl.hxx  |1 -
 dbaccess/source/core/dataaccess/datasource.hxx |1 -
 .../source/inc/OAuthenticationContinuation.hxx |2 +-
 dbaccess/source/ui/browser/formadapter.cxx |1 -
 dbaccess/source/ui/inc/JoinDesignView.hxx  |1 -
 dbaccess/source/ui/inc/RelationDesignView.hxx  |1 -
 dbaccess/source/ui/inc/TableRow.hxx|1 -
 dbaccess/source/ui/inc/charsets.hxx|2 +-
 desktop/source/app/langselect.hxx  |1 -
 .../deployment/gui/dp_gui_dependencydialog.cxx |1 -
 editeng/source/editeng/editdbg.hxx |1 -
 extensions/source/dbpilots/optiongrouplayouter.cxx |1 -
 .../source/plugin/inc/plugin/unx/mediator.hxx  |1 -
 extensions/source/propctrlr/eformshelper.hxx   |2 +-
 extensions/source/propctrlr/pcrcommon.hxx  |1 -
 extensions/source/propctrlr/proplinelistener.hxx   |2 +-
 extensions/source/propctrlr/stringdefine.hxx   |1 -
 extensions/source/xmlextract/xmxcom.hxx|1 -
 extensions/workben/testcomponent.cxx   |1 -
 filter/inc/filter/msfilter/mstoolbar.hxx   |1 -
 forms/source/component/imgprod.hxx |1 -
 formula/inc/formula/ExternalReferenceHelper.hxx|2 +-
 fpicker/source/office/fpsmartcontent.cxx   |1 -
 framework/inc/framework/eventsconfiguration.hxx|1 -
 framework/inc/framework/statusbarconfiguration.hxx |1 -
 framework/inc/framework/toolboxconfiguration.hxx   |1 -
 framework/source/classes/fwlresid.cxx  |1 -
 framework/source/fwe/classes/fwkresid.cxx  |1 -
 .../uiconfiguration/uicategorydescription.cxx  |1 -
 l10ntools/inc/l10ntools/directory.hxx  |1 -
 l10ntools/source/directory.cxx |2 +-
 linguistic/source/convdicxml.hxx   |1 -
 lotuswordpro/source/filter/lwpheader.hxx   |1 -
 reportdesign/source/ui/inc/FunctionHelper.hxx  |1 -
 rsc/inc/rscall.h   |1 -
 rsc/inc/rscdb.hxx  |1 +
 rsc/inc/rsctools.hxx   |3 ++-
 sc/inc/dpsave.hxx  |1 -
 sc/inc/sortparam.hxx   |1 -
 sc/source/core/inc/core_pch.hxx|1 -
 sc/source/filter/inc/biff.hxx  |1 -
 sc/source/filter/inc/decl.h|1 -
 sc/source/filter/inc/filt_pch.hxx  |1 -
 sc/source/filter/inc/formel.hxx|1 -
 sc/source/filter/inc/qproform.hxx  |1 -
 sc/source/filter/xml/sheetdata.cxx |2 +-
 sc/source/ui/inc/formdata.hxx  |1 -
 sc/source/ui/inc/ui_pch.hxx|1 -
 sc/source/ui/unoobj/scdetect.hxx   |1 -
 sc/source/ui/unoobj/unodoc.cxx |2 +-
 sd/source/ui/dlg/sdabstdlg.cxx |2 +-
 sd/source/ui/inc/unokywds.hxx  |1 -
 .../toolpanel/controls/RecentlyUsedMasterPages.hxx |1 -
 sd/source/ui/unoidl/sddetect.hxx   |1 -
 sd/source/ui/unoidl/unodoc.cxx |2 +-
 sfx2/inc/frmload.hxx   |1 -
 sfx2/inc/sfx2/sfxresid.hxx |1 -
 sfx2/source/dialog/sfxdlg.cxx  |1 -
 sfx2/source/doc/SfxDocumentMetaData.cxx|1 -
 starmath/source/smdetect.hxx   |1 -
 starmath/source/unodoc.cxx |1 -
 svl/source/items/cntwall.cxx   |1 -
 svl/source/memtools/svarray.cxx|1 -
 svtools/inc/svtools/accessibilityoptions.hxx   |1 -
 svtools/source/contnr/treelist.cxx |1 -
 svtools/source/misc/wallitem.cxx   |1 -
 svtools/workben/cui/loadlib.cxx|1 -
 svx/inc/svx/fmsrccfg.hxx   |1 -
 svx/inc/svx/msdffdef.hxx   |1 -
 svx/inc/svx/sdrhittesthelper.hxx   |1 -
 svx/inc/svx/svdsob.hxx |4 
 svx/source/accessibility/ShapeTypeHandler.cxx  |1 -
 svx/source/form/fmtools.cxx|1 -
 svx/source/inc/fmvwimp.hxx |1 -
 svx/source/smarttags/SmartTagMgr.cxx   |1 -
 sw/inc/SwNumberTree.hxx|1 -
 sw/inc/index.hxx

[Libreoffice] [PATCH 5/5] Removed unnecessary tools includes.

2012-01-03 Thread Marcel Metz
---
 sd/source/filter/eppt/pptx-epptbase.cxx |1 -
 sfx2/source/doc/docfile.cxx |1 -
 sfx2/source/doc/objstor.cxx |1 -
 vcl/unx/generic/app/salinst.cxx |1 -
 4 files changed, 0 insertions(+), 4 deletions(-)


diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx
index 75bab47..f4823aa 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx
+++ b/sd/source/filter/eppt/pptx-epptbase.cxx
@@ -35,7 +35,6 @@
 #include tools/datetime.hxx
 #include tools/poly.hxx
 #include tools/stream.hxx
-#include tools/zcodec.hxx
 #include vcl/graph.hxx
 #include vcl/bmpacc.hxx
 #include vcl/gradient.hxx
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index abe827e..d4711c6 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -72,7 +72,6 @@
 #include com/sun/star/beans/PropertyValue.hpp
 #include com/sun/star/security/DocumentSignatureInformation.hpp
 #include com/sun/star/security/XDocumentDigitalSignatures.hpp
-#include tools/zcodec.hxx
 #include tools/urlobj.hxx
 #include unotools/tempfile.hxx
 #include comphelper/processfactory.hxx
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 3fbe37d..8355ebd 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -31,7 +31,6 @@
 #include svl/eitem.hxx
 #include svl/stritem.hxx
 #include svl/intitem.hxx
-#include tools/zcodec.hxx
 #include com/sun/star/frame/XStorable.hpp
 #include com/sun/star/frame/XModel.hpp
 #include com/sun/star/frame/XFrame.hpp
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index 33e4ede..3fac1ec 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -32,7 +32,6 @@
 #include stdlib.h
 
 #include osl/module.hxx
-#include tools/solarmutex.hxx
 
 #include unx/salunx.h
 #include unx/saldata.hxx

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 1/2] Added missing includes.

2012-01-03 Thread Marcel Metz
---
 binfilter/inc/bf_starmath/smmod.hxx |2 ++
 binfilter/inc/bf_sw/shellres.hxx|2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/binfilter/inc/bf_starmath/smmod.hxx
b/binfilter/inc/bf_starmath/smmod.hxx
index f3f4ec4..1ec73db 100644
--- a/binfilter/inc/bf_starmath/smmod.hxx
+++ b/binfilter/inc/bf_starmath/smmod.hxx
@@ -29,6 +29,8 @@
 #ifndef _SMMOD_HXX
 #define _SMMOD_HXX
 +#include i18npool/lang.h
+#include tools/rc.hxx
 #include tools/resary.hxx
 #include bf_svtools/lstner.hxx
 #include bf_svtools/colorcfg.hxx
diff --git a/binfilter/inc/bf_sw/shellres.hxx
b/binfilter/inc/bf_sw/shellres.hxx
index 847d749..9f6c979 100644
--- a/binfilter/inc/bf_sw/shellres.hxx
+++ b/binfilter/inc/bf_sw/shellres.hxx
@@ -31,7 +31,7 @@
 #include bf_svtools/bf_solar.h
  -
+#include tools/rc.hxx
 #include vcl/bitmap.hxx
  #ifndef _SVSTDARR_HXX
-- 
1.7.6.4

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Remove unused code

2011-12-28 Thread Marcel Metz
Hello lo-devs,

There is never an instance of mpDateTable allocated and a lot of
code is never executed because of that. This patch removes the
unused code.

regards Marcel

---
 svtools/inc/svtools/calendar.hxx|3 -
 svtools/source/control/calendar.cxx |  119
++-
 2 files changed, 6 insertions(+), 116 deletions(-)


diff --git a/svtools/inc/svtools/calendar.hxx b/svtools/inc/svtools/calendar.hxx
index d17d970..9395b0a 100644
--- a/svtools/inc/svtools/calendar.hxx
+++ b/svtools/inc/svtools/calendar.hxx
@@ -45,8 +45,6 @@ class HelpEvent;
 class DataChangedEvent;
 class FloatingWindow;
 class PushButton;
-struct ImplDateInfo;
-class ImplDateTable;
 class ImplCFieldFloatWin;
 
 /*
@@ -173,7 +171,6 @@ oder durch Beendigung einer Selektion ausgeloest.
 class SVT_DLLPUBLIC Calendar : public Control
 {
 private:
-ImplDateTable*  mpDateTable;
 Table*  mpSelectTable;
 Table*  mpOldSelectTable;
 Table*  mpRestoreSelectTable;
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index e1d536d..20dce27 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -77,23 +77,6 @@ using namespace ::com::sun::star;
 
 // ===
 
-struct ImplDateInfo
-{
-XubString   maText;
-Color*  mpTextColor;
-Color*  mpFrameColor;
-sal_uInt16  mnFlags;
-
-ImplDateInfo( const XubString rText ) :
-maText( rText )
-{ mpTextColor = mpFrameColor = NULL; mnFlags = 0; }
-~ImplDateInfo() { delete mpTextColor; delete mpFrameColor; }
-};
-
-DECLARE_TABLE( ImplDateTable, ImplDateInfo* )
-
-// ===
-
 static void ImplCalendarSelectDate( Table* pTable, const Date rDate, sal_Bool bSelect )
 {
 if ( bSelect )
@@ -196,7 +179,6 @@ inline void ImplCalendarClearSelectDate( Table* pTable )
 
 void Calendar::ImplInit( WinBits nWinStyle )
 {
-mpDateTable = NULL;
 mpSelectTable   = new Table;
 mpOldSelectTable= NULL;
 mpRestoreSelectTable= NULL;
@@ -307,18 +289,6 @@ Calendar::~Calendar()
 delete mpSaturdayColor;
 delete mpSundayColor;
 
-if ( mpDateTable )
-{
-ImplDateInfo* pDateInfo = mpDateTable-First();
-while ( pDateInfo )
-{
-delete pDateInfo;
-pDateInfo = mpDateTable-Next();
-}
-
-delete mpDateTable;
-}
-
 delete mpSelectTable;
 if ( mpOldSelectTable )
 delete mpOldSelectTable;
@@ -770,7 +740,6 @@ void Calendar::ImplDrawDate( long nX, long nY,
  DayOfWeek eDayOfWeek,
  sal_Bool bBack, sal_Bool bOther, sal_uLong nToday )
 {
-ImplDateInfo*   pDateInfo;
 Color*  pTextColor = NULL;
 const String   rDay = *(mpDayText[nDay-1]);
 Rectangle   aDateRect( nX, nY, nX+mnDayWidth-1, nY+mnDayHeight-1 );
@@ -788,16 +757,6 @@ void Calendar::ImplDrawDate( long nX, long nY,
 bSel = sal_True;
 }
 
-// Dateinfo ermitteln
-if ( mpDateTable )
-{
-pDateInfo = mpDateTable-Get( Date( nDay, nMonth, nYear ).GetDate() );
-if ( !pDateInfo )
-pDateInfo = mpDateTable-Get( Date( nDay, nMonth, 0 ).GetDate() );
-}
-else
-pDateInfo = NULL;
-
 // Textfarbe ermitteln
 if ( bSel )
 pTextColor = maSelColor;
@@ -805,17 +764,12 @@ void Calendar::ImplDrawDate( long nX, long nY,
 pTextColor = maOtherColor;
 else
 {
-if ( pDateInfo  pDateInfo-mpTextColor )
-pTextColor = pDateInfo-mpTextColor;
-else
-{
-if ( eDayOfWeek == SATURDAY )
-pTextColor = mpSaturdayColor;
-else if ( eDayOfWeek == SUNDAY )
-pTextColor = mpSundayColor;
-if ( !pTextColor )
-pTextColor = mpStandardColor;
-}
+if ( eDayOfWeek == SATURDAY )
+pTextColor = mpSaturdayColor;
+else if ( eDayOfWeek == SUNDAY )
+pTextColor = mpSundayColor;
+if ( !pTextColor )
+pTextColor = mpStandardColor;
 }
 
 if ( bFocus )
@@ -824,17 +778,6 @@ void Calendar::ImplDrawDate( long nX, long nY,
 // Font ermitteln
 Font aOldFont = GetFont();
 sal_Bool bBoldFont = sal_False;
-if ( (mnWinStyle  WB_BOLDTEXT) 
- pDateInfo  (pDateInfo-mnFlags  DIB_BOLD) )
-{
-bBoldFont = sal_True;
-Font aFont = aOldFont;
-if ( aFont.GetWeight()  WEIGHT_BOLD )
-aFont.SetWeight( WEIGHT_BOLD );
-else
-aFont.SetWeight( WEIGHT_NORMAL );
-SetFont( aFont );
-}
 
 // Hintergrund ausgeben
 const StyleSettings 

[Libreoffice] [PATCH] Removed copyright notice printing from regular execution of FCFGMerge.

2011-12-23 Thread Marcel Metz
Hello lo-devs,


this patch reduces the copyright notice noise of the FCFGMerge tool.

regards Marcel

---
 l10ntools/source/filter/merge/FCFGMerge.java |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/l10ntools/source/filter/merge/FCFGMerge.java b/l10ntools/source/filter/merge/FCFGMerge.java
index 2c2f35b..ca1959b 100644
--- a/l10ntools/source/filter/merge/FCFGMerge.java
+++ b/l10ntools/source/filter/merge/FCFGMerge.java
@@ -56,8 +56,6 @@ public class FCFGMerge
 
 public static void main(java.lang.String[] sCmdLine)
 {
-FCFGMerge.printCopyright();
-
 // create log object in default mode WARNINGS
 // If a command line parameter indicates another
 // level - change it!
@@ -77,6 +75,7 @@ public class FCFGMerge
 // help requested?
 if (aCfg.isHelp())
 {
+FCFGMerge.printCopyright();
 FCFGMerge.printHelp();
 System.exit(-1);
 }

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] c1db721 ScChangeActionTable conversion: Yet another correction.

2011-12-22 Thread Marcel Metz
Hello Eike,

after testing the change tracking feature in calc I've found yet
another bug in the UI. The attached patch fixes the bug in
question.

regards Marcel

---
 sc/source/ui/miscdlgs/acredlin.cxx |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index a35f556..fee43d4 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1218,7 +1218,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvLBoxE
 ++itChangeAction;
 }
 
-if( itChangeAction != pActionMap-end() )
+if( itChangeAction == pActionMap-end() )
 return true;
 
 SvLBoxEntry* pOriginal = InsertChangeActionContent(

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Replace SwTxtPortionTable with std::map.

2011-12-21 Thread Marcel Metz
Hello lo-devs,

this patch replaces yet another Table class use.

regards Marcel Metz
---
 sw/source/core/text/inftxt.hxx |   19 ---
 1 files changed, 12 insertions(+), 7 deletions(-)


diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 34845ec..0dc05d0 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -30,7 +30,7 @@
 #include com/sun/star/linguistic2/XHyphenatedWord.hpp
 #include com/sun/star/beans/PropertyValues.hpp
 
-#include tools/table.hxx
+#include map
 
 #include swtypes.hxx
 #include txttypes.hxx
@@ -168,14 +168,14 @@ public:
  *  class SwTxtSizeInfo
  */
 
-DECLARE_TABLE( SwTxtPortionTable, sal_IntPtr )
+typedef ::std::map sal_uLong, sal_IntPtr  SwTxtPortionMap;
 
 class SwTxtSizeInfo : public SwTxtInfo
 {
 protected:
 // during formatting, a small database is built, mapping portion pointers
 // to their maximum size (used for kana compression)
-SwTxtPortionTable aMaxWidth;
+SwTxtPortionMap aMaxWidth;
 // for each line, an array of compression values is calculated
 // this array is passed over to the info structure
 std::dequesal_uInt16* pKanaComp;
@@ -343,19 +343,24 @@ public:
 // stored in aMaxWidth and discarded after a line has been formatted.
 inline void SetMaxWidthDiff( sal_uLong nKey, sal_uInt16 nVal )
 {
-aMaxWidth.Insert( nKey, nVal );
+aMaxWidth.insert( ::std::make_pair( nKey, nVal ) );
 };
 inline sal_uInt16 GetMaxWidthDiff( sal_uLong nKey )
 {
-return (sal_uInt16)aMaxWidth.Get( nKey );
+SwTxtPortionMap::iterator it = aMaxWidth.find( nKey );
+
+if( it != aMaxWidth.end() )
+return it-second;
+else
+return 0;
 };
 inline void ResetMaxWidthDiff()
 {
-aMaxWidth.Clear();
+aMaxWidth.clear();
 };
 inline sal_Bool CompressLine()
 {
-return (sal_Bool)aMaxWidth.Count();
+return (sal_Bool)!aMaxWidth.empty();
 };
 
 //

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PUSHED] Re: [PATCH] fdo#38832 Replace ScChangeActionTable with std::map.

2011-12-21 Thread Marcel Metz
On 21.12.2011 20:27, Michael Stahl wrote:

 pushed to master, with 2 small corrections:

 this here inverted the logic, Get == 0 means not found:
 -   if ( p != pAct  !rTable.Get( p-GetActionNumber() ) )
 +   if ( p != pAct  rMap.find( p-GetActionNumber() ) != rMap.end() )

 and in ScChangeTrack::Reject, the old code iterated from end to start
 (dunno if that is important there, but why not use a reverse_iterator)

 thanks for the patch!

Thanks for the review. You're right, the reverse_iterator is closer to
the old behaviour.

regards Marcel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH] fdo#38832 Replace ScChangeActionTable with std::map.

2011-12-21 Thread Marcel Metz
On 21.12.2011 21:00, Eike Rathke wrote:
 
 The assertion tells if there was a dup, in that case something was going
 wrong and memory leaks.
 
 Anyway, aparently you were confused by the two different tables/maps and
 mixing iterator from different map, see
 http://cgit.freedesktop.org/libreoffice/core/commit/?id=c1db721af6286ae4c3164075337d81e943845938
 

Oh, good catch. I've overlooked that when reviewing the patch myself.

 Note that instead of map.erase(key) you can use map.erase(iterator) if
 you already obtained one and don't access it afterwards, that saves an
 internal map.find(key)

I will keep that in mind for future patches.

 Btw, did you check if Calc changetracking and accepting/rejecting
 actions still works?

Well, I assumed that this was cached by the `make check` tests but If
you're asking like that I think this isn't sufficient, right?

regards Marcel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 1/4] fdo38832 Replace ImplAccelTable with std::map

2011-12-10 Thread Marcel Metz
Hello lo-devs,

This patch series replaces some DECLARE_TABLE macros with
the std::map equivalent.

regards

Marcel

---
 vcl/source/window/accel.cxx |   20 
 1 files changed, 12 insertions(+), 8 deletions(-)


diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index f45b145..e755d48 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -27,18 +27,18 @@
  /
 
 
-#include tools/table.hxx
 #include tools/debug.hxx
 #include tools/rc.h
 
 #include vcl/svapp.hxx
 #include accel.h
 #include vcl/accel.hxx
+#include map
 #include vector
 
 // ===
 
-DECLARE_TABLE( ImplAccelTable, ImplAccelEntry* )
+typedef ::std::map sal_uLong, ImplAccelEntry*  ImplAccelMap;
 typedef ::std::vector ImplAccelEntry*  ImplAccelList;
 
 #define ACCELENTRY_NOTFOUND ((sal_uInt16)0x)
@@ -48,8 +48,8 @@ typedef ::std::vector ImplAccelEntry*  ImplAccelList;
 class ImplAccelData
 {
 public:
-ImplAccelTable  maKeyTable; // for keycodes, generated with a code
-ImplAccelList   maIdList;   // Id-List
+ImplAccelMap  maKeyMap; // for keycodes, generated with a code
+ImplAccelList maIdList; // Id-List
 };
 
 // ===
@@ -179,7 +179,11 @@ void Accelerator::ImplInit()
 
 ImplAccelEntry* Accelerator::ImplGetAccelData( const KeyCode rKeyCode ) const
 {
-return mpData-maKeyTable.Get( rKeyCode.GetFullKeyCode() );
+ImplAccelMap::iterator it = mpData-maKeyMap.find( rKeyCode.GetFullKeyCode() );
+if( it != mpData-maKeyMap.end() )
+return it-second;
+else
+return NULL;
 }
 
 // ---
@@ -200,7 +204,7 @@ void Accelerator::ImplCopyData( ImplAccelData rAccelData )
 else
 pEntry-mpAutoAccel = NULL;
 
-mpData-maKeyTable.Insert( (sal_uLong)pEntry-maKeyCode.GetFullKeyCode(), pEntry );
+mpData-maKeyMap.insert( std::make_pair( pEntry-maKeyCode.GetFullKeyCode(), pEntry ) );
 mpData-maIdList.push_back( pEntry );
 }
 }
@@ -267,7 +271,7 @@ void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode rKeyCode,
 OSL_FAIL( Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed );
 delete pEntry;
 }
-else if ( !mpData-maKeyTable.Insert( nCode, pEntry ) )
+else if ( mpData-maKeyMap.insert( std::make_pair( nCode, pEntry ) ).second )
 {
 OSL_TRACE( Accelerator::InsertItem(): KeyCode (Key: %lx) already exists, nCode );
 delete pEntry;
@@ -470,7 +474,7 @@ Accelerator Accelerator::operator=( const Accelerator rAccel )
 
 // delete and copy tables
 ImplDeleteData();
-mpData-maKeyTable.Clear();
+mpData-maKeyMap.clear();
 ImplCopyData( *((ImplAccelData*)(rAccel.mpData)) );
 
 return *this;

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 2/4] Replace Table with std::map

2011-12-10 Thread Marcel Metz
---
 cui/source/dialogs/pastedlg.cxx |   20 
 cui/source/inc/pastedlg.hxx |4 ++--
 2 files changed, 14 insertions(+), 10 deletions(-)


diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx
index 47fdf2f..656a813 100644
--- a/cui/source/dialogs/pastedlg.cxx
+++ b/cui/source/dialogs/pastedlg.cxx
@@ -112,11 +112,10 @@ void SvPasteObjectDialog::SetDefault()
 
 SvPasteObjectDialog::~SvPasteObjectDialog()
 {
-void * pStr = aSupplementTable.First();
-while( pStr )
+::std::map SotFormatStringId, String* ::iterator it;
+for(it = aSupplementMap.begin(); it != aSupplementMap.end(); ++it)
 {
-delete (String *)pStr;
-pStr = aSupplementTable.Next();
+delete it-second;
 }
 }
 
@@ -126,7 +125,7 @@ SvPasteObjectDialog::~SvPasteObjectDialog()
 void SvPasteObjectDialog::Insert( SotFormatStringId nFormat, const String rFormatName )
 {
 String * pStr = new String( rFormatName );
-if( !aSupplementTable.Insert( nFormat, pStr ) )
+if( !aSupplementMap.insert( ::std::make_pair( nFormat, pStr ) ).second )
 delete pStr;
 }
 
@@ -156,20 +155,25 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper rHelper,
 ::com::sun::star::datatransfer::DataFlavor aFlavor( *aIter );
 SotFormatStringId nFormat = (*aIter++).mnSotId;
 
-String* pName = (String*) aSupplementTable.Get( nFormat );
+String* pName = NULL;
 String aName;
+::std::map SotFormatStringId, String* ::iterator itName;
+itName = aSupplementMap.find( nFormat );
 
 // if there is an Embed Source or and Embedded Object on the
 // Clipboard we read the Description and the Source of this object
 // from an accompanied Object Descriptor format on the clipboard
 // Remember: these formats mostly appear together on the clipboard
-if ( !pName )
+if ( itName == aSupplementMap.end() )
 {
 SvPasteObjectHelper::GetEmbeddedName(rHelper,aName,aSourceName,nFormat);
 if ( aName.Len() )
 pName = aName;
 }
-
+else
+{
+pName = itName-second;
+}
 
 if( pName )
 {
diff --git a/cui/source/inc/pastedlg.hxx b/cui/source/inc/pastedlg.hxx
index 93c6ff4..ddf4ccb 100644
--- a/cui/source/inc/pastedlg.hxx
+++ b/cui/source/inc/pastedlg.hxx
@@ -29,7 +29,7 @@
 #ifndef _PASTEDLG_HXX
 #define _PASTEDLG_HXX
 
-#include tools/table.hxx
+#include map
 #include sot/formats.hxx
 #include tools/globname.hxx
 #include svtools/transfer.hxx
@@ -60,7 +60,7 @@ class SvPasteObjectDialog : public ModalDialog
 OKButton aOKButton1;
 CancelButton aCancelButton1;
 HelpButton aHelpButton1;
-Table   aSupplementTable;
+::std::map SotFormatStringId, String*  aSupplementMap;
 SvGlobalNameaObjClassName;
 String  aObjName;
 sal_uInt16  nAspect;

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 3/4] Replace _SvxForbiddenCharacterTable_Impl with std::map

2011-12-10 Thread Marcel Metz
---
 cui/source/options/optasian.cxx |   73
+++
 1 files changed, 36 insertions(+), 37 deletions(-)


diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index 5cafe5d..326f4dc 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -26,13 +26,13 @@
  *
  /
 
+#include map
 #include optasian.hxx
 #include editeng/langitem.hxx
 #include editeng/unolingu.hxx
 #include optasian.hrc
 #include dialmgr.hxx
 #include cuires.hrc
-#include tools/table.hxx
 #include tools/shl.hxx
 #include svl/asiancfg.hxx
 #include com/sun/star/lang/Locale.hpp
@@ -59,77 +59,76 @@ const sal_Char cCharacterCompressionType[] = CharacterCompressionType;
 
 struct SvxForbiddenChars_Impl
 {
+~SvxForbiddenChars_Impl();
+
 sal_BoolbRemoved;
 ForbiddenCharacters*pCharacters;
 };
 
-DECLARE_TABLE( _SvxForbiddenCharacterTable_Impl, SvxForbiddenChars_Impl* )
-
-class SvxForbiddenCharacterTable_Impl : public _SvxForbiddenCharacterTable_Impl
+SvxForbiddenChars_Impl::~SvxForbiddenChars_Impl()
 {
-public:
-SvxForbiddenCharacterTable_Impl()
-: _SvxForbiddenCharacterTable_Impl( 4, 4 )
-{}
-~SvxForbiddenCharacterTable_Impl();
-};
+delete this-pCharacters;
+}
+
+typedef ::std::map LanguageType, SvxForbiddenChars_Impl*  SvxForbiddenCharacterMap_Impl;
 
 struct SvxAsianLayoutPage_Impl
 {
 SvxAsianConfig  aConfig;
 SvxAsianLayoutPage_Impl() {}
 
+~SvxAsianLayoutPage_Impl();
+
 Reference XForbiddenCharactersxForbidden;
 Reference XPropertySetxPrSet;
 Reference XPropertySetInfoxPrSetInfo;
-SvxForbiddenCharacterTable_Impl aChangedLanguagesTbl;
+SvxForbiddenCharacterMap_Impl   aChangedLanguagesMap;
 
 sal_BoolhasForbiddenCharacters(LanguageType eLang);
 SvxForbiddenChars_Impl* getForbiddenCharacters(LanguageType eLang);
 voidaddForbiddenCharacters(LanguageType eLang, ForbiddenCharacters* pForbidden);
 };
 
-SvxForbiddenCharacterTable_Impl::~SvxForbiddenCharacterTable_Impl()
+SvxAsianLayoutPage_Impl::~SvxAsianLayoutPage_Impl()
 {
-for( SvxForbiddenChars_Impl*  pDel = First(); pDel; pDel = Next() )
+SvxForbiddenCharacterMap_Impl::iterator it;
+for( it = aChangedLanguagesMap.begin(); it != aChangedLanguagesMap.end(); ++it )
 {
-delete pDel-pCharacters;
-delete pDel;
+delete it-second;
 }
 }
 
 sal_BoolSvxAsianLayoutPage_Impl::hasForbiddenCharacters(LanguageType eLang)
 {
-return 0 != aChangedLanguagesTbl.Get(eLang);
+return aChangedLanguagesMap.count( eLang );
 }
 
 SvxForbiddenChars_Impl* SvxAsianLayoutPage_Impl::getForbiddenCharacters(LanguageType eLang)
 {
-SvxForbiddenChars_Impl* pImp = aChangedLanguagesTbl.Get(eLang);
-DBG_ASSERT(pImp, language not available);
-if(pImp)
-return pImp;
+SvxForbiddenCharacterMap_Impl::iterator it = aChangedLanguagesMap.find( eLang );
+DBG_ASSERT( ( it == aChangedLanguagesMap.end() ), language not available);
+if( it != aChangedLanguagesMap.end() )
+return it-second;
 return 0;
 }
 
 void SvxAsianLayoutPage_Impl::addForbiddenCharacters(
 LanguageType eLang, ForbiddenCharacters* pForbidden)
 {
-SvxForbiddenChars_Impl* pOld = aChangedLanguagesTbl.Get(eLang);
-if( !pOld )
+SvxForbiddenCharacterMap_Impl::iterator itOld = aChangedLanguagesMap.find( eLang );
+if( itOld == aChangedLanguagesMap.end() )
 {
-pOld = new SvxForbiddenChars_Impl;
-pOld-bRemoved = 0 == pForbidden;
-pOld-pCharacters = pForbidden ? new ForbiddenCharacters(*pForbidden) : 0;
-aChangedLanguagesTbl.Insert( eLang, pOld );
+SvxForbiddenChars_Impl* pChar = new SvxForbiddenChars_Impl;
+pChar-bRemoved = 0 == pForbidden;
+pChar-pCharacters = pForbidden ? new ForbiddenCharacters(*pForbidden) : 0;
+aChangedLanguagesMap.insert( ::std::make_pair( eLang, pChar ) );
 }
 else
 {
-pOld-bRemoved = 0 == pForbidden;
-delete pOld-pCharacters;
-pOld-pCharacters = pForbidden ? new ForbiddenCharacters(*pForbidden) : 0;
+itOld-second-bRemoved = 0 == pForbidden;
+delete itOld-second-pCharacters;
+itOld-second-pCharacters = pForbidden ? new ForbiddenCharacters(*pForbidden) : 0;
 }
-
 }
 
 static LanguageType eLastUsedLanguageTypeForForbiddenCharacters = USHRT_MAX;
@@ -209,16 +208,16 @@ sal_Bool SvxAsianLayoutPage::FillItemSet( SfxItemSet )
 {
 try
 {
-for( SvxForbiddenChars_Impl*  pElem = pImpl-aChangedLanguagesTbl.First();
-pElem; pElem = pImpl-aChangedLanguagesTbl.Next() )
+SvxForbiddenCharacterMap_Impl::iterator itElem;
+for( itElem = pImpl-aChangedLanguagesMap.begin();
+itElem != pImpl-aChangedLanguagesMap.end(); 

[Libreoffice] [PATCH 4/4] Replace Table with std::map

2011-12-10 Thread Marcel Metz
---
 svl/source/misc/inettype.cxx |   38 ++
 1 files changed, 22 insertions(+), 16 deletions(-)


diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index 1cba9dc..b043f06 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -85,8 +85,9 @@ class Registration
 {
 typedef boost::ptr_mapUniString, TypeNameMapEntry  TypeNameMap;
 typedef boost::ptr_mapUniString, ExtensionMapEntry ExtensionMap;
+typedef std::mapINetContentType, TypeIDMapEntry*   TypeIDMap;
 
-Table m_aTypeIDMap; // map TypeID to TypeName, Presentation
+TypeIDMapm_aTypeIDMap;// map ContentType to TypeID
 TypeNameMap  m_aTypeNameMap;  // map TypeName to TypeID, Extension
 ExtensionMap m_aExtensionMap; // map Extension to TypeID
 sal_uInt32 m_nNextDynamicID;
@@ -127,8 +128,13 @@ namespace
 // static
 inline TypeIDMapEntry * Registration::getEntry(INetContentType eTypeID)
 {
-return static_cast TypeIDMapEntry * (theRegistration::get().
-m_aTypeIDMap.Get(eTypeID));
+Registration rRegistration = theRegistration::get();
+
+TypeIDMap::iterator it = rRegistration.m_aTypeIDMap.find( eTypeID );
+if( it != rRegistration.m_aTypeIDMap.end() )
+return it-second;
+else
+return NULL;
 }
 
 //
@@ -526,10 +532,8 @@ MediaTypeEntry const aStaticPresentationMap[]
 //
 Registration::~Registration()
 {
-{for (sal_uLong i = 0; i  m_aTypeIDMap.Count(); ++i)
-delete static_cast TypeIDMapEntry * (m_aTypeIDMap.GetObject(i));
-}
-m_aTypeIDMap.Clear();
+for ( TypeIDMap::iterator it = m_aTypeIDMap.begin(); it != m_aTypeIDMap.end(); ++it )
+delete it-second;
 }
 
 //
@@ -571,7 +575,7 @@ INetContentType Registration::RegisterContentType(UniString const  rTypeName,
 pTypeIDMapEntry-m_aPresentation = rPresentation;
 if (pSystemFileType)
 pTypeIDMapEntry-m_aSystemFileType = *pSystemFileType;
-rRegistration.m_aTypeIDMap.Insert(eTypeID, pTypeIDMapEntry);
+rRegistration.m_aTypeIDMap.insert( ::std::make_pair( eTypeID, pTypeIDMapEntry ) );
 
 std::auto_ptrTypeNameMapEntry pTypeNameMapEntry(new TypeNameMapEntry());
 if (pExtension)
@@ -609,10 +613,11 @@ UniString Registration::GetContentType(INetContentType eTypeID)
 {
 Registration rRegistration = theRegistration::get();
 
-TypeIDMapEntry * pEntry
-= static_cast TypeIDMapEntry * (rRegistration.
-  m_aTypeIDMap.Get(eTypeID));
-return pEntry ? pEntry-m_aTypeName : UniString();
+TypeIDMap::iterator pEntry = rRegistration.m_aTypeIDMap.find( eTypeID );
+if( pEntry != rRegistration.m_aTypeIDMap.end() )
+return pEntry-second-m_aTypeName;
+else
+return  UniString();
 }
 
 //
@@ -621,10 +626,11 @@ UniString Registration::GetPresentation(INetContentType eTypeID)
 {
 Registration rRegistration = theRegistration::get();
 
-TypeIDMapEntry * pEntry
-= static_cast TypeIDMapEntry * (rRegistration.
-  m_aTypeIDMap.Get(eTypeID));
-return pEntry ? pEntry-m_aPresentation : UniString();
+TypeIDMap::iterator pEntry = rRegistration.m_aTypeIDMap.find( eTypeID );
+if( pEntry != rRegistration.m_aTypeIDMap.end() )
+return pEntry-second-m_aPresentation;
+else
+return  UniString();
 }
 
 //

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Removed unnessecary tools/table.hxx includes.

2011-12-06 Thread Marcel Metz
Hello LO-devs,

As the subject already mentions this patch removes unnessecary
header includes for the tools table implementation.

I'm using OpenGrok quite often for the cleanups so I would like
to know how often the indices are updated.

---
 filter/source/xsltdialog/xmlfileview.hxx   |1 -
 .../hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx   |1 -
 .../source/spellcheck/macosxspell/macspellimp.hxx  |1 -
 .../source/spellcheck/spell/sspellimp.hxx  |1 -
 .../source/thesaurus/libnth/nthesimp.hxx   |2 --
 linguistic/workben/sspellimp.hxx   |1 -
 rsc/source/tools/rscchar.cxx   |2 --
 sc/source/filter/inc/xcl97esc.hxx  |1 -
 sfx2/source/bastyp/frmhtml.cxx |1 -
 svx/inc/svx/msdffdef.hxx   |1 -
 svx/inc/svx/xtable.hxx |1 -
 sw/inc/docary.hxx  |1 -
 sw/inc/hints.hxx   |1 -
 sw/source/filter/writer/writer.cxx |1 +
 14 files changed, 1 insertions(+), 15 deletions(-)


diff --git a/filter/source/xsltdialog/xmlfileview.hxx b/filter/source/xsltdialog/xmlfileview.hxx
index b03bc76..5edd096 100644
--- a/filter/source/xsltdialog/xmlfileview.hxx
+++ b/filter/source/xsltdialog/xmlfileview.hxx
@@ -35,7 +35,6 @@
 #include tools/table.hxx
 #include svtools/xtextedt.hxx
 #include vcl/timer.hxx
-#include tools/table.hxx
 #include vcl/wrkwin.hxx
 #include vcl/ctrl.hxx
 #include vcl/button.hxx
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx
index fb2ba59..933155b 100644
--- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx
+++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx
@@ -42,7 +42,6 @@
 #include com/sun/star/linguistic2/XHyphenator.hpp
 #include com/sun/star/linguistic2/XSearchableDictionaryList.hpp
 #include com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp
-#include tools/table.hxx
 
 #include unotools/charclass.hxx
 
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx b/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx
index f877685..1f88342 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx
@@ -48,7 +48,6 @@
 #include com/sun/star/linguistic2/XSpellChecker.hpp
 #include com/sun/star/linguistic2/XSearchableDictionaryList.hpp
 #include com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp
-#include tools/table.hxx
 
 #include linguistic/misc.hxx
 #include linguistic/lngprophelp.hxx
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.hxx b/lingucomponent/source/spellcheck/spell/sspellimp.hxx
index c561b22..d862dbd 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.hxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.hxx
@@ -41,7 +41,6 @@
 #include com/sun/star/linguistic2/XSpellChecker.hpp
 #include com/sun/star/linguistic2/XSearchableDictionaryList.hpp
 #include com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp
-#include tools/table.hxx
 
 #include linguistic/misc.hxx
 #include linguistic/lngprophelp.hxx
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx
index 7baa32d..58957f9 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx
@@ -47,8 +47,6 @@
 #include com/sun/star/linguistic2/XLinguServiceManager.hpp
 #include com/sun/star/linguistic2/XSpellChecker1.hpp
 
-#include tools/table.hxx
-
 #include unotools/charclass.hxx
 
 #include lingutil.hxx
diff --git a/linguistic/workben/sspellimp.hxx b/linguistic/workben/sspellimp.hxx
index 5e839b4..b2ebeff 100644
--- a/linguistic/workben/sspellimp.hxx
+++ b/linguistic/workben/sspellimp.hxx
@@ -41,7 +41,6 @@
 #include com/sun/star/linguistic2/XSpellChecker.hpp
 #include com/sun/star/linguistic2/XSearchableDictionaryList.hpp
 #include com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp
-#include tools/table.hxx
 
 #include linguistic/misc.hxx
 #include sprophelp.hxx
diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx
index c43874c..f4b7464 100644
--- a/rsc/source/tools/rscchar.cxx
+++ b/rsc/source/tools/rscchar.cxx
@@ -31,8 +31,6 @@
 #include string.h
 #include ctype.h
 
-#include tools/table.hxx
-
 // Solar Definitionen
 #include tools/solar.h
 #include rsctools.hxx
diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index a2af601..3634874 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -31,7 +31,6 @@
 
 #include memory
 #include stack
-#include tools/table.hxx
 #include filter/msfilter/escherex.hxx
 #include xlescher.hxx
 #include xeroot.hxx
diff --git 

[Libreoffice] [PATCH 07/11] Replace Stack with std::stack LineInfo*

2011-12-01 Thread Marcel Metz
---
 vcl/source/gdi/cvtsvm.cxx |   19 +++
 1 files changed, 11 insertions(+), 8 deletions(-)


diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 7d9ec4d..bb5628f 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -29,7 +29,6 @@
 
 #include algorithm
 #include string.h
-#include tools/stack.hxx
 #include tools/debug.hxx
 #include tools/stream.hxx
 #include vcl/virdev.hxx
@@ -530,7 +529,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream rIStm, GDIMetaFile rMtf )
 }
 
 LineInfoaLineInfo( LINE_NONE, 0 );
-Stack   aLIStack;
+::std::stack LineInfo*  aLIStack;
 VirtualDevice   aFontVDev;
 rtl_TextEncodingeActualCharSet = osl_getThreadTextEncoding();
 sal_BoolbFatLine = sal_False;
@@ -1145,7 +1144,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream rIStm, GDIMetaFile rMtf )
 
 case( GDI_PUSH_ACTION ):
 {
-aLIStack.Push( new LineInfo( aLineInfo ) );
+aLIStack.push( new LineInfo( aLineInfo ) );
 rMtf.AddAction( new MetaPushAction( PUSH_ALL ) );
 
 // #106172# Track font relevant data in shadow VDev
@@ -1156,7 +1155,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream rIStm, GDIMetaFile rMtf )
 case( GDI_POP_ACTION ):
 {
 
-LineInfo* pLineInfo = (LineInfo*) aLIStack.Pop();
+LineInfo* pLineInfo = aLIStack.top();
+aLIStack.pop();
 
 // restore line info
 if( pLineInfo )
@@ -1353,11 +1353,14 @@ void SVMConverter::ImplConvertFromSVM1( SvStream rIStm, GDIMetaFile rMtf )
 rIStm.SeekRel( nActionSize - 4L );
 break;
 }
-}
+}
 
-// cleanup push-pop stack if neccessary
-for( void* pLineInfo = aLIStack.Pop(); pLineInfo; pLineInfo = aLIStack.Pop() )
-delete (LineInfo*) pLineInfo;
+// cleanup push-pop stack if neccessary
+while( !aLIStack.empty() )
+{
+delete aLIStack.top();
+aLIStack.pop();
+}
 
 rIStm.SetNumberFormatInt( nOldFormat );
 }

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 11/11] Remove unused tools/stack.hxx

2011-12-01 Thread Marcel Metz
---
 sc/source/filter/inc/filt_pch.hxx |1 -
 tools/Package_inc.mk  |1 -
 tools/inc/tools/stack.hxx |  103
-
 3 files changed, 0 insertions(+), 105 deletions(-)
 delete mode 100644 tools/inc/tools/stack.hxx


diff --git a/sc/source/filter/inc/filt_pch.hxx b/sc/source/filter/inc/filt_pch.hxx
index 805cad1..aa0115e 100644
--- a/sc/source/filter/inc/filt_pch.hxx
+++ b/sc/source/filter/inc/filt_pch.hxx
@@ -219,7 +219,6 @@
 #include com/sun/star/lang/WrappedTargetException.hdl
 #include com/sun/star/lang/WrappedTargetException.hpp
 #include sfx2/shell.hxx
-#include tools/stack.hxx
 #include com/sun/star/lang/XComponent.hpp
 #include com/sun/star/lang/XComponent.hdl
 #include editeng/svxenum.hxx
diff --git a/tools/Package_inc.mk b/tools/Package_inc.mk
index d1ca76b..fc36d8c 100644
--- a/tools/Package_inc.mk
+++ b/tools/Package_inc.mk
@@ -79,7 +79,6 @@ $(eval $(call gb_Package_add_file,tools_inc,inc/tools/shl.hxx,tools/shl.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/simplerm.hxx,tools/simplerm.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/solar.h,tools/solar.h))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/solarmutex.hxx,tools/solarmutex.hxx))
-$(eval $(call gb_Package_add_file,tools_inc,inc/tools/stack.hxx,tools/stack.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/stream.hxx,tools/stream.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/string.hxx,tools/string.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/svborder.hxx,tools/svborder.hxx))
diff --git a/tools/inc/tools/stack.hxx b/tools/inc/tools/stack.hxx
deleted file mode 100644
index a8f8cb5..000
--- a/tools/inc/tools/stack.hxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * http://www.openoffice.org/license.html
- * for a copy of the LGPLv3 License.
- *
- /
-
-#ifndef _STACK_HXX
-#define _STACK_HXX
-
-#include tools/contnr.hxx
-
-// -
-// - Stack -
-// -
-
-#define STACK_ENTRY_NOTFOUND   CONTAINER_ENTRY_NOTFOUND
-
-class Stack : private Container
-{
-public:
-using Container::Clear;
-using Container::Count;
-using Container::GetObject;
-using Container::GetPos;
-
-Stack( sal_uInt16 _nInitSize = 16, sal_uInt16 _nReSize = 16 ) :
-Container( CONTAINER_MAXBLOCKSIZE, _nInitSize, _nReSize ) {}
-Stack( const Stack rStack ) : Container( rStack ) {}
-
-voidPush( void* p ) { Container::Insert( p, CONTAINER_APPEND ); }
-void*   Pop()   { return Container::Remove( Count()-1 ); }
-void*   Top() const { return Container::GetObject( Count()-1 ); }
-
-Stack  operator =( const Stack rStack )
-{ Container::operator =( rStack ); return *this; }
-
-sal_Booloperator ==( const Stack rStack ) const
-{ return Container::operator ==( rStack ); }
-sal_Booloperator !=( const Stack rStack ) const
-{ return Container::operator !=( rStack ); }
-};
-
-// -
-// - DECLARE_STACK -
-// -
-
-#define DECLARE_STACK( ClassName, Type )\
-class ClassName : private Stack \
-{   \
-public: \
-using Stack::Clear; \
-using Stack::Count; \
-\
-ClassName( sal_uInt16 _nInitSize = 16,  \
-   sal_uInt16 _nReSize = 16 ) : \
-Stack( _nInitSize, _nReSize ) {}\

[Libreoffice] [PATCH 02/11] Replace Stack with std::stack bool

2011-12-01 Thread Marcel Metz
---
 sc/source/filter/xml/xmlfilti.hxx |   24 ++--
 1 files changed, 18 insertions(+), 6 deletions(-)


diff --git a/sc/source/filter/xml/xmlfilti.hxx b/sc/source/filter/xml/xmlfilti.hxx
index 92a094c..11a5300 100644
--- a/sc/source/filter/xml/xmlfilti.hxx
+++ b/sc/source/filter/xml/xmlfilti.hxx
@@ -36,7 +36,6 @@
 #include com/sun/star/sheet/FilterOperator.hpp
 #include com/sun/star/sheet/FilterOperator2.hpp
 #include com/sun/star/sheet/TableFilterField2.hpp
-#include tools/stack.hxx
 
 #include xmldrani.hxx
 #include xmldpimp.hxx
@@ -228,7 +227,7 @@ class ScXMLDPFilterContext : public SvXMLImportContext
 boolbConnectionOr;
 boolbNextConnectionOr;
 boolbConditionSourceRange;
-Stack   aConnectionOrStack;
+::std::stackbool  aConnectionOrStack;
 
 const ScXMLImport GetScImport() const { return (const ScXMLImport)GetImport(); }
 ScXMLImport GetScImport() { return (ScXMLImport)GetImport(); }
@@ -252,10 +251,23 @@ public:
 
 void SetIsCaseSensitive(const bool bTemp) { bIsCaseSensitive = bTemp; }
 void SetUseRegularExpressions(const bool bTemp) { if (!bUseRegularExpressions) bUseRegularExpressions = bTemp;}
-void OpenConnection(const bool bTemp) { bool* pTemp = new bool; *pTemp = bConnectionOr;
-bConnectionOr = bNextConnectionOr; bNextConnectionOr = bTemp;
-aConnectionOrStack.Push(pTemp);}
-void CloseConnection() { bool* pTemp = static_cast bool* (aConnectionOrStack.Pop()); bConnectionOr = *pTemp; bNextConnectionOr = *pTemp; delete pTemp;}
+
+void OpenConnection(const bool bTemp)
+{
+bool pTemp = bConnectionOr;
+bConnectionOr = bNextConnectionOr;
+bNextConnectionOr = bTemp;
+aConnectionOrStack.push(pTemp);
+}
+
+void CloseConnection()
+{
+bool pTemp = aConnectionOrStack.top();
+aConnectionOrStack.pop();
+bConnectionOr = pTemp;
+bNextConnectionOr = pTemp;
+}
+
 bool GetConnection() { bool bTemp = bConnectionOr; bConnectionOr = bNextConnectionOr; return bTemp; }
 void AddFilterField (const ScQueryEntry aFilterField);
 };

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 03/11] Replace Stack with std::stack std::pair XclObj*, XclEscherHostAppData*

2011-12-01 Thread Marcel Metz
---
 sc/source/filter/inc/xcl97esc.hxx   |4 ++--
 sc/source/filter/xcl97/xcl97esc.cxx |   10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index df7c09d..a2af601 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -30,8 +30,8 @@
 #define SC_XCL97ESC_HXX
 
 #include memory
+#include stack
 #include tools/table.hxx
-#include tools/stack.hxx
 #include filter/msfilter/escherex.hxx
 #include xlescher.hxx
 #include xeroot.hxx
@@ -149,7 +149,7 @@ private:
 
 private:
 XclExpObjectManager mrObjMgr;
-Stack   aStack;
+std::stack std::pair XclObj*, XclEscherHostAppData*   aStack;
 XclObj* pCurrXclObj;
 XclEscherHostAppData*   pCurrAppData;
 XclEscherClientData*pTheClientData; // always the same
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 50b7e9e..207a37d 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -115,7 +115,7 @@ XclEscherEx::XclEscherEx( const XclExpRoot rRoot, XclExpObjectManager rObjMgr,
 
 XclEscherEx::~XclEscherEx()
 {
-OSL_ENSURE( !aStack.Count(), ~XclEscherEx: stack not empty );
+OSL_ENSURE( !aStack.empty(), ~XclEscherEx: stack not empty );
 DeleteCurrAppData();
 delete pTheClientData;
 }
@@ -207,8 +207,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference XShape  rxShape
 UpdateDffFragmentEnd();
 }
 }
-aStack.Push( pCurrXclObj );
-aStack.Push( pCurrAppData );
+aStack.push( std::make_pair( pCurrXclObj, pCurrAppData ) );
 pCurrAppData = new XclEscherHostAppData;
 SdrObject* pObj = GetSdrObjectFromXShape( rxShape );
 if ( !pObj )
@@ -347,8 +346,9 @@ void XclEscherEx::EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID )
 
 // get next object from stack
 DeleteCurrAppData();
-pCurrAppData = static_cast XclEscherHostAppData* ( aStack.Pop() );
-pCurrXclObj = static_cast XclObj* ( aStack.Pop() );
+pCurrXclObj = aStack.top().first;
+pCurrAppData = aStack.top().second;
+aStack.pop();
 if( nAdditionalText == 3 )
 nAdditionalText = 0;
 }

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 10/11] Replace ScHTMLAdjustStack with std::stack ScHTMLAdjustStackEntry*

2011-12-01 Thread Marcel Metz
---
 sc/source/filter/html/htmlpars.cxx |   14 ++
 sc/source/filter/inc/htmlpars.hxx  |4 +---
 2 files changed, 11 insertions(+), 7 deletions(-)


diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index bb79d59f..67644c2 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -545,8 +545,11 @@ void ScHTMLLayoutParser::Adjust()
 ScEEParseEntry* pE = maList[ i ];
 if ( pE-nTab  nTab )
 {   // Table beendet
-if ( (pS = aStack.Pop()) != 0 )
+if ( !aStack.empty() )
 {
+pS = aStack.top();
+aStack.pop();
+
 nLastCol = pS-nLastCol;
 nNextRow = pS-nNextRow;
 nCurRow = pS-nCurRow;
@@ -574,7 +577,7 @@ void ScHTMLLayoutParser::Adjust()
 nLastCol = pE-nCol;// eingelesene Col
 if ( pE-nTab  nTab )
 {   // neue Table
-aStack.Push( new ScHTMLAdjustStackEntry(
+aStack.push( new ScHTMLAdjustStackEntry(
 nLastCol, nNextRow, nCurRow ) );
 nTab = pE-nTab;
 pTab = (pTables ? (Table*) pTables-Get( nTab ) : NULL);
@@ -643,8 +646,11 @@ void ScHTMLLayoutParser::Adjust()
 if ( nRowMax  nRowTmp )
 nRowMax = nRowTmp;
 }
-while ( (pS = aStack.Pop()) != 0 )
-delete pS;
+while ( !aStack.empty() )
+{
+delete aStack.top();
+aStack.pop();
+}
 }
 
 
diff --git a/sc/source/filter/inc/htmlpars.hxx b/sc/source/filter/inc/htmlpars.hxx
index d8f6ea4..4c3ea8e 100644
--- a/sc/source/filter/inc/htmlpars.hxx
+++ b/sc/source/filter/inc/htmlpars.hxx
@@ -29,8 +29,6 @@
 #ifndef SC_HTMLPARS_HXX
 #define SC_HTMLPARS_HXX
 
-#include tools/stack.hxx
-
 #include memory
 #include stack
 #include vector
@@ -158,7 +156,7 @@ struct ScHTMLAdjustStackEntry
 nCurRow( nCRow )
 {}
 };
-DECLARE_STACK( ScHTMLAdjustStack, ScHTMLAdjustStackEntry* )
+typedef ::std::stack ScHTMLAdjustStackEntry*  ScHTMLAdjustStack;
 
 
 // 

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 06/11] Replace Stack with std::stack Color*

2011-12-01 Thread Marcel Metz
---
 vcl/inc/vcl/cvtsvm.hxx|5 ++---
 vcl/source/gdi/cvtsvm.cxx |   16 ++--
 2 files changed, 12 insertions(+), 9 deletions(-)


diff --git a/vcl/inc/vcl/cvtsvm.hxx b/vcl/inc/vcl/cvtsvm.hxx
index de4158e..370871b 100644
--- a/vcl/inc/vcl/cvtsvm.hxx
+++ b/vcl/inc/vcl/cvtsvm.hxx
@@ -29,6 +29,7 @@
 #ifndef _SV_CVTMTF_HXX
 #define _SV_CVTMTF_HXX
 
+#include stack
 #include vcl/dllapi.h
 #include vcl/metaact.hxx
 #include vcl/gdimtf.hxx
@@ -91,8 +92,6 @@
 // - SVMConverter -
 // 
 
-class Stack;
-
 class VCL_PLUGIN_PUBLIC SVMConverter
 {
 private:
@@ -100,7 +99,7 @@ private:
 SAL_DLLPRIVATE void ImplConvertToSVM1( SvStream rOStm, GDIMetaFile rMtf );
 SAL_DLLPRIVATE sal_uLongImplWriteActions( SvStream rOStm, GDIMetaFile rMtf,
   VirtualDevice rSaveVDev, sal_Bool rRop_0_1,
-  Color rLineCol, Stack rLineColStack,
+  Color rLineCol, ::std::stackColor* rLineColStack,
   rtl_TextEncoding rActualCharSet );
 
 public:
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 92b326c..7d9ec4d 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -1374,7 +1374,7 @@ void SVMConverter::ImplConvertToSVM1( SvStream rOStm, GDIMetaFile rMtf )
 sal_BoolbRop_0_1 = sal_False;
 VirtualDevice   aSaveVDev;
 Color   aLineCol( COL_BLACK );
-Stack   aLineColStack;
+::std::stack Color*   aLineColStack;
 
 rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
 
@@ -1399,15 +1399,18 @@ void SVMConverter::ImplConvertToSVM1( SvStream rOStm, GDIMetaFile rMtf )
 rOStm.SetNumberFormatInt( nOldFormat );
 
 // cleanup push-pop stack if neccessary
-for( void* pCol = aLineColStack.Pop(); pCol; pCol = aLineColStack.Pop() )
-delete (Color*) pCol;
+while ( !aLineColStack.empty() )
+{
+delete aLineColStack.top();
+aLineColStack.pop();
+}
 }
 
 // 
 
 sal_uLong SVMConverter::ImplWriteActions( SvStream rOStm, GDIMetaFile rMtf,
   VirtualDevice rSaveVDev, sal_Bool rRop_0_1,
-  Color rLineCol, Stack rLineColStack,
+  Color rLineCol, ::std::stack Color*  rLineColStack,
   rtl_TextEncoding rActualCharSet )
 {
 sal_uLong nCount = 0;
@@ -2054,7 +2057,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream rOStm, GDIMetaFile rMtf,
 case( META_PUSH_ACTION ):
 {
 ImplWritePushAction( rOStm );
-rLineColStack.Push( new Color( rLineCol ) );
+rLineColStack.push( new Color( rLineCol ) );
 rSaveVDev.Push();
 nCount++;
 }
@@ -2062,7 +2065,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream rOStm, GDIMetaFile rMtf,
 
 case( META_POP_ACTION ):
 {
-Color* pCol = (Color*) rLineColStack.Pop();
+Color* pCol = rLineColStack.top();
+rLineColStack.pop();
 
 if( pCol )
 {

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 08/11] Replace Stack with std::stack SVGAttributeWriter*

2011-12-01 Thread Marcel Metz
---
 filter/source/svg/svgwriter.hxx |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)


diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index dd033a2..0b6048e 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -29,13 +29,13 @@
 #ifndef SVGWRITER_HXX
 #define SVGWRITER_HXX
 
+#include stack
 #include cppuhelper/weak.hxx
 #include rtl/ustring.hxx
 #include tools/debug.hxx
 #include tools/stream.hxx
 #include tools/string.hxx
 #include tools/urlobj.hxx
-#include tools/stack.hxx
 #include vcl/salbtype.hxx
 #include vcl/gdimtf.hxx
 #include vcl/metaact.hxx
@@ -164,7 +164,7 @@ private:
 sal_Int32   mnCurGradientId;
 sal_Int32   mnCurMaskId;
 sal_Int32   mnCurPatternId;
-Stack   maContextStack;
+::std::stack SVGAttributeWriter*  maContextStack;
 ::std::auto_ptr SVGShapeDescriptormapCurShape;
 SVGExport  mrExport;
 SVGFontExport  mrFontExport;
@@ -179,8 +179,17 @@ private:
 sal_BoolmbIsPlacehlolderShape;
 
 
-SVGAttributeWriter* ImplAcquireContext() { maContextStack.Push( mpContext = new SVGAttributeWriter( mrExport, mrFontExport ) ); return mpContext; }
-voidImplReleaseContext() { delete (SVGAttributeWriter*)maContextStack.Pop(); mpContext = (SVGAttributeWriter*) maContextStack.Top(); }
+SVGAttributeWriter* ImplAcquireContext()
+{
+maContextStack.push( mpContext = new SVGAttributeWriter( mrExport, mrFontExport ) );
+return mpContext;
+}
+voidImplReleaseContext()
+{
+delete maContextStack.top();
+maContextStack.pop();
+mpContext = maContextStack.top();
+}
 
 longImplMap( sal_Int32 nVal ) const;
 Point  ImplMap( const Point rPt, Point rDstPt ) const;

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH 01/11] Replace ScChangeTrackMsgStack with std::stack ScChangeTrackMsgInfo*

2011-12-01 Thread Marcel Metz

Hello libreoffice devs,

this is my first patch series to the lo project. It replaces the use
of the tools Stack class and corresponding macros with the std::stack
as suggested in in bug #39445 [1] (an easy hack).

I would like to continue with cleaning up the tools module. I've seen
that there are other containers in tools like a Table which probably
could be replaced in most places with a std::table or a std::vector and
the List that could be replaced with std::vector. Should I set up a new
Bug for that or can I just hack on if there aren't any objections on
these changes?

[1] https://bugs.freedesktop.org/show_bug.cgi?id=39445#c1
---
 sc/inc/chgtrack.hxx|   10 +---
 sc/source/core/tool/chgtrack.cxx   |   69
+++
 sc/source/filter/inc/XclExpChangeTrack.hxx |1 +
 3 files changed, 42 insertions(+), 38 deletions(-)


diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx
index 11159ed..5dc02d8 100644
--- a/sc/inc/chgtrack.hxx
+++ b/sc/inc/chgtrack.hxx
@@ -30,11 +30,11 @@
 #define SC_CHGTRACK_HXX
 
 #include deque
+#include stack
 
 #include tools/string.hxx
 #include tools/datetime.hxx
 #include tools/table.hxx
-#include tools/stack.hxx
 #include tools/mempool.hxx
 #include tools/link.hxx
 #include unotools/options.hxx
@@ -689,8 +689,6 @@ enum ScChangeActionContentCellType
 SC_CACCT_MATREF
 };
 
-class Stack;
-
 class ScChangeActionContent : public ScChangeAction
 {
 friend class ScChangeTrack;
@@ -779,7 +777,7 @@ class ScChangeActionContent : public ScChangeAction
 // pRejectActions!=NULL: reject actions get
 // stacked, no SetNewValue, no Append
 sal_BoolSelect( ScDocument*, ScChangeTrack*,
-sal_Bool bOldest, Stack* pRejectActions );
+sal_Bool bOldest, ::std::stackScChangeActionContent** pRejectActions );
 
 voidPutValueToDoc( ScBaseCell*, const String,
 ScDocument*, SCsCOL nDx, SCsROW nDy ) const;
@@ -901,8 +899,6 @@ public:
 
 // --- ScChangeActionReject -
 
-class Stack;
-
 class ScChangeActionReject : public ScChangeAction
 {
 friend class ScChangeTrack;
@@ -955,7 +951,7 @@ struct ScChangeTrackMsgInfo
 
 // MsgQueue for notification via ModifiedLink
 typedef std::dequeScChangeTrackMsgInfo* ScChangeTrackMsgQueue;
-DECLARE_STACK( ScChangeTrackMsgStack, ScChangeTrackMsgInfo* )
+typedef std::stackScChangeTrackMsgInfo* ScChangeTrackMsgStack;
 
 enum ScChangeTrackMergeState
 {
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index b63e5c6..8063cc9 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -29,7 +29,6 @@
 
 
 #include tools/shl.hxx// SHL_CALC
-#include tools/stack.hxx
 #include tools/rtti.hxx
 #include svl/zforlist.hxx
 #include svl/itemset.hxx
@@ -53,13 +52,9 @@
 
 #include globstr.hrc
 
-#include stack
-
 #define SC_CHGTRACK_CXX
 #include chgtrack.hxx
 
-DECLARE_STACK( ScChangeActionStack, ScChangeAction* )
-
 const sal_uInt16 nMemPoolChangeActionCellListEntry = (0x2000 - 64) / sizeof(ScChangeActionCellListEntry);
 IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionCellListEntry, nMemPoolChangeActionCellListEntry, nMemPoolChangeActionCellListEntry )
 
@@ -1518,7 +1513,7 @@ sal_Bool ScChangeActionContent::Reject( ScDocument* pDoc )
 
 
 sal_Bool ScChangeActionContent::Select( ScDocument* pDoc, ScChangeTrack* pTrack,
-sal_Bool bOldest, Stack* pRejectActions )
+sal_Bool bOldest, ::std::stackScChangeActionContent** pRejectActions )
 {
 if ( !aBigRange.IsValid( pDoc ) )
 return false;
@@ -1563,7 +1558,7 @@ sal_Bool ScChangeActionContent::Select( ScDocument* pDoc, ScChangeTrack* pTrack,
 pNew-SetRejectAction( bOldest ? GetActionNumber() : pEnd-GetActionNumber() );
 pNew-SetState( SC_CAS_ACCEPTED );
 if ( pRejectActions )
-pRejectActions-Push( pNew );
+pRejectActions-push( pNew );
 else
 {
 pNew-SetNewValue( pDoc-GetCell( rPos ), pDoc );
@@ -2143,11 +2138,16 @@ void ScChangeTrack::ClearMsgQueue()
 delete pBlockModifyMsg;
 pBlockModifyMsg = NULL;
 }
-ScChangeTrackMsgInfo* pMsgInfo;
-while ( ( pMsgInfo = aMsgStackTmp.Pop() ) != NULL )
-delete pMsgInfo;
-while ( ( pMsgInfo = aMsgStackFinal.Pop() ) != NULL )
-delete pMsgInfo;
+while ( !aMsgStackTmp.empty() )
+{
+delete aMsgStackTmp.top();
+aMsgStackTmp.pop();
+}
+while ( !aMsgStackFinal.empty() );
+{
+delete aMsgStackFinal.top();
+aMsgStackFinal.pop();
+}
 
 ScChangeTrackMsgQueue::iterator itQueue;
 for ( itQueue = aMsgQueue.begin(); itQueue != aMsgQueue.end(); ++itQueue)
@@ -2214,7 +2214,7 @@ void ScChangeTrack::StartBlockModify( 

[Libreoffice] [PATCH 05/11] Replace SmNodeStack with std::stack SmNode*

2011-12-01 Thread Marcel Metz
---
 starmath/inc/parse.hxx   |3 +-
 starmath/source/math_pch.cxx |1 -
 starmath/source/mathmlimport.cxx |  223
++
 starmath/source/mathmlimport.hxx |8 ++-
 starmath/source/parse.cxx|  222
--
 5 files changed, 279 insertions(+), 178 deletions(-)


diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index b8834be..5e4ce31 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -30,7 +30,6 @@
 
 
 #include vcl/svapp.hxx
-#include tools/stack.hxx
 #include tools/string.hxx
 
 #include set
@@ -167,7 +166,7 @@ struct SmErrorDesc
 };
 
 
-DECLARE_STACK(SmNodeStack,  SmNode *)
+typedef ::std::stack SmNode*  SmNodeStack;
 typedef ::std::vector SmErrorDesc*  SmErrDescList;
 
 /**/
diff --git a/starmath/source/math_pch.cxx b/starmath/source/math_pch.cxx
index 1119a19..b9e2270 100644
--- a/starmath/source/math_pch.cxx
+++ b/starmath/source/math_pch.cxx
@@ -141,7 +141,6 @@
 #include tools/datetime.hxx
 #include tools/wldcrd.hxx
 #include parse.hxx
-#include tools/stack.hxx
 #include types.hxx
 #include config.hxx
 #include svtools/confitem.hxx
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index b4d57bb..f42b420 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -747,8 +747,9 @@ void SmXMLContext_Helper::ApplyAttrs()
 aToken.eType = TNBOLD;
 SmStructureNode *pFontNode = static_castSmStructureNode *
 (new SmFontNode(aToken));
-pFontNode-SetSubNodes(0,rNodeStack.Pop());
-rNodeStack.Push(pFontNode);
+pFontNode-SetSubNodes(0,rNodeStack.top());
+rNodeStack.pop();
+rNodeStack.push(pFontNode);
 }
 if (nIsItalic != -1)
 {
@@ -758,8 +759,9 @@ void SmXMLContext_Helper::ApplyAttrs()
 aToken.eType = TNITALIC;
 SmStructureNode *pFontNode = static_castSmStructureNode *
 (new SmFontNode(aToken));
-pFontNode-SetSubNodes(0,rNodeStack.Pop());
-rNodeStack.Push(pFontNode);
+pFontNode-SetSubNodes(0,rNodeStack.top());
+rNodeStack.pop();
+rNodeStack.push(pFontNode);
 }
 if (nFontSize != 0.0)
 {
@@ -779,8 +781,9 @@ void SmXMLContext_Helper::ApplyAttrs()
 else
 pFontNode-SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT);
 
-pFontNode-SetSubNodes(0,rNodeStack.Pop());
-rNodeStack.Push(pFontNode);
+pFontNode-SetSubNodes(0,rNodeStack.top());
+rNodeStack.pop();
+rNodeStack.push(pFontNode);
 }
 if (sFontFamily.getLength())
 {
@@ -798,8 +801,9 @@ void SmXMLContext_Helper::ApplyAttrs()
 
 aToken.aText = sFontFamily;
 SmFontNode *pFontNode = new SmFontNode(aToken);
-pFontNode-SetSubNodes(0,rNodeStack.Pop());
-rNodeStack.Push(pFontNode);
+pFontNode-SetSubNodes(0,rNodeStack.top());
+rNodeStack.pop();
+rNodeStack.push(pFontNode);
 }
 if (sColor.getLength())
 {
@@ -812,8 +816,9 @@ void SmXMLContext_Helper::ApplyAttrs()
 if (aToken.eType != -1)
 {
 SmFontNode *pFontNode = new SmFontNode(aToken);
-pFontNode-SetSubNodes(0,rNodeStack.Pop());
-rNodeStack.Push(pFontNode);
+pFontNode-SetSubNodes(0,rNodeStack.top());
+rNodeStack.pop();
+rNodeStack.push(pFontNode);
 }
 }
 
@@ -846,7 +851,7 @@ public:
 SmXMLRowContext_Impl(SmXMLImport rImport,sal_uInt16 nPrefix,
 const OUString rLName)
 : SmXMLDocContext_Impl(rImport,nPrefix,rLName)
-{ nElementCount = GetSmImport().GetNodeStack().Count(); }
+{ nElementCount = GetSmImport().GetNodeStack().size(); }
 
 virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString rLocalName, const uno::Reference xml::sax::XAttributeList  xAttrList);
 
@@ -925,7 +930,7 @@ void SmXMLStyleContext_Impl::EndElement()
 arguments
 */
 SmNodeStack rNodeStack = GetSmImport().GetNodeStack();
-if (rNodeStack.Count() - nElementCount  1)
+if (rNodeStack.size() - nElementCount  1)
 SmXMLRowContext_Impl::EndElement();
 aStyleHelper.ApplyAttrs();
 }
@@ -950,7 +955,7 @@ void SmXMLPaddedContext_Impl::EndElement()
 contents are treated as a single inferred mrow containing its
 arguments
 */
-if (GetSmImport().GetNodeStack().Count() - nElementCount  1)
+if (GetSmImport().GetNodeStack().size() - nElementCount  1)
 SmXMLRowContext_Impl::EndElement();
 }
 
@@ -974,7 +979,7 @@ void SmXMLPhantomContext_Impl::EndElement()
 contents are treated as a single inferred 

Re: [Libreoffice] [PATCH 01/11] Replace ScChangeTrackMsgStack with std::stack ScChangeTrackMsgInfo*

2011-12-01 Thread Marcel Metz
Hello Eike,


On 01.12.2011 20:28, Eike Rathke wrote:
 Hi Marcel,

 On Thursday, 2011-12-01 11:08:40 +0100, Marcel Metz wrote:

 this is my first patch series to the lo project.
 Wow, large and great one :-)
 I'll inspect details later or tomorrow, from a first glance it looks
 good.

 In the mean time, as this is your first contribution to the code base,
 could you please send a blanket statement to the mailing list
 (preferably in this thread) that you contribute this and further patches
 under LGPLv3+ and MPL 1.1 licenses? After having done so you may also
 want to add yourself to
 https://wiki.documentfoundation.org/Development/Developers and in the
 License column point to that mail in the archive.

 Thanks
   Eike



 ___
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/libreoffice

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH 01/11] Replace ScChangeTrackMsgStack with std::stack ScChangeTrackMsgInfo*

2011-12-01 Thread Marcel Metz
Hello Eike,

 In the mean time, as this is your first contribution to the
 code base, could you please send a blanket statement to the
 mailing list (preferably in this thread) that you contribute
 this and further patches under LGPLv3+ and MPL 1.1 licenses?

I totally forgot that, well today doesn't seem to be my day…

I provide this and all future contributions to the libreoffice
project under the terms of the LGPLv3+ and MPL 1.1 license.

regards

Marcel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice