Hints for Bug 61495 - Indentation difference for Backspace and Shift+Enter after conversion to .doc/.docx

2013-03-01 Thread Maciej Rumianowski
Hi *,

I have found a Bug in LibreOffice Writer
https://bugs.freedesktop.org/show_bug.cgi?id=61495 and I would like to hack
on this.

I need a hint, where is code for export filter to docx or doc?

Best Regards,
Maciek
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


The meaning of core/starmath/sdi/smath.sdi

2013-02-21 Thread Maciej Rumianowski
Hi *,

does someone know what is the meaning of this (
http://opengrok.libreoffice.org/xref/core/starmath/sdi/smath.sdi) file?
It uses a lot of SfxVoidItem which I am currently investigating and trying
to use as DisabledItem mark.

http://cgit.freedesktop.org/libreoffice/core/tree/svl/source/items/itemset.cxx

> void SfxItemSet::DisableItem(sal_uInt16 nWhich)
> {
> DBG_CHKTHIS(SfxItemSet, 0);
> Put( SfxVoidItem(0), nWhich );
> }
>
> Because of Bug 34465 Items should be inserted at same nWhich as their
.Which().

Best Regards,
Maciek
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2013-02-20 Thread Maciej Rumianowski
Hi Bjoern,

2012/11/30 Bjoern Michaelsen 

> Yes, there are quite a few evil cornercases lurking there. Before changing
> those conditionals, I think it is a good idea to just add assertions that
> make
> sure these assumptions are kept consistent all the time. A start would be
> to
> check that when an item is put in the set, to check:
> - If it has a non-zero Which-Id
> - and is not a SfxVoidItem
> any client code that does something different (even explicitly putting a
> SfxVoidItem), is abusing the API and should be fixed by making it call
> DisableItem instead). Once you are sure that is cleaned up, one can
> carefully
> go on about changing the conditions. Some care is still needed as in
> theory,
> someone might have e.g. put a non-zero, non-SfxVoidItem and later set the
> WhichId on the item to 0.
>

after a break I found sometime to hack :)
There is one place where SfxVoidItem is used instead of DisableItem
function.:
http://opengrok.libreoffice.org/xref/core/editeng/source/editeng/eerdll.cxx#150

> SfxPoolItem** GlobalEditData::GetDefItems()
> {
> if ( !ppDefItems )
> {
> ppDefItems = new SfxPoolItem*[EDITITEMCOUNT];
>
> // Paragraph attributes:
> SvxNumRule aTmpNumRule( 0, 0, sal_False );
>
> ppDefItems[0]  = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP,
> EE_PARA_WRITINGDIR );
> ppDefItems[1]  = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS );
> ppDefItems[2]  = new SfxBoolItem( EE_PARA_HANGINGPUNCTUATION,
> sal_False );
> ppDefItems[3]  = new SfxBoolItem( EE_PARA_FORBIDDENRULES, sal_True
> );
> ...
> ppDefItems[17] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD,
> EE_PARA_VER_JUST );
>
> // Character attributes:
> ppDefItems[18] = new SvxColorItem( Color( COL_AUTO ),
> EE_CHAR_COLOR );
> ppDefItems[19] = new SvxFontItem( EE_CHAR_FONTINFO );
>  ...

ppDefItems[38] = new SvxFontHeightItem( 240, 100,
> EE_CHAR_FONTHEIGHT_CTL );
> ppDefItems[39] = new SvxWeightItem( WEIGHT_NORMAL,
> EE_CHAR_WEIGHT_CJK );
> ppDefItems[40] = new SvxWeightItem( WEIGHT_NORMAL,
> EE_CHAR_WEIGHT_CTL );
> ppDefItems[41] = new SvxPostureItem( ITALIC_NONE,
> EE_CHAR_ITALIC_CJK );
> ppDefItems[42] = new SvxPostureItem( ITALIC_NONE,
> EE_CHAR_ITALIC_CTL );
> ppDefItems[43] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE,
> EE_CHAR_EMPHASISMARK );
> ppDefItems[44] = new SvxCharReliefItem( RELIEF_NONE,
> EE_CHAR_RELIEF );
> ppDefItems[45] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY );
> ppDefItems[46] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS );
> ppDefItems[47] = new SvxOverlineItem( UNDERLINE_NONE,
> EE_CHAR_OVERLINE );
>
> // Features
> ppDefItems[48] = new SfxVoidItem( EE_FEATURE_TAB );
> ppDefItems[49] = new SfxVoidItem( EE_FEATURE_LINEBR );
> ppDefItems[50] = new SvxCharSetColorItem( Color( COL_RED ),
> RTL_TEXTENCODING_DONTKNOW, EE_FEATURE_NOTCONV );
> ppDefItems[51] = new SvxFieldItem( SvxFieldData(),
> EE_FEATURE_FIELD );
>
> DBG_ASSERT( EDITITEMCOUNT == 52, "ITEMCOUNT geaendert, DefItems
> nicht angepasst!" );
>
> // Init DefFonts:
> GetDefaultFonts( *(SvxFontItem*)ppDefItems[EE_CHAR_FONTINFO -
> EE_ITEMS_START],
>  *(SvxFontItem*)ppDefItems[EE_CHAR_FONTINFO_CJK -
> EE_ITEMS_START],
>  *(SvxFontItem*)ppDefItems[EE_CHAR_FONTINFO_CTL -
> EE_ITEMS_START] );
> }
>
> return ppDefItems;
> }
>
What about this? Changing to SvxColorItem crashes
CppunitTest_sw_subsequent_odfexport on
Program received signal SIGSEGV, Segmentation fault.
0x45c4f134 in CharAttribList::InsertAttrib (this=0x8676b60, pAttrib=0x0) at
/home/maciej/programowanie/libreoffice/libo-working/editeng/source/editeng/editdoc.cxx:2661
2661const sal_uInt16 nStart = pAttrib->GetStart(); // may be better
for Comp.Opt.
#0  0x45c4f134 in CharAttribList::InsertAttrib (this=0x8676b60,
pAttrib=0x0) at
/home/maciej/programowanie/libreoffice/libo-working/editeng/source/editeng/editdoc.cxx:2661
#1  0x45c4e7d3 in EditDoc::InsertAttrib (this=0x86766a0, rPoolItem=...,
pNode=0x8676b40, nStart=0, nEnd=0) at
/home/maciej/programowanie/libreoffice/libo-working/editeng/source/editeng/editdoc.cxx:2473
#2  0x45c4e9fb in EditDoc::InsertAttrib (this=0x86766a0, pNode=0x8676b40,
nStart=0, nEnd=0, rPoolItem=...) at
/home/maciej/programowanie/libreoffice/libo-working/editeng/source/editeng/editdoc.cxx:2515
#3  0x45d07e44 in ImpEditEngine::SetAttribs (this=0x8676630, aSel=...,
rSet=..., nSpecial=1 '\001') at
/home/maciej/programowanie/libreoffice/libo-working/editeng/source/editeng/impedit5.cxx:551

because based on ItemState it should be disabled and never go beyond #3.
This shows that Item EE_CHAR_RUBI_DUMMY (4036) is by default disabled, and
never explicitly with DisableItem function.

Thanks in advance for any help/advice

Best Regards,
Maciek
__

Re: Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2012-11-30 Thread Maciej Rumianowski
Hi Bjoern,

thanks for reply :)

So, to change the conditionals, we need to make sure the state is
> consistent.
> Thus:
> - adding the asserts
>
Do you mean  DBG_ASSERT or real assert? How do debug those  DBG_ASSERT,
when compiling I don't get a lot of output. My command is
make 2>&1 | tee build.log.all

and autogen.lastrun
--disable-gnome-vfs
--without-doxygen
--disable-mozilla
--disable-binfilter
--with-parallelism=3
--enable-debug
--enable-dbgutil


> Does that make sense?
>
I get the Idea, but I need to check some places in code.
I will suspend all my other changes in SfxItemSet and first clean things
with disabled items. I will post patches that it could be tested on other
platforms.

Best Regards,
Maciek
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2012-11-30 Thread Maciej Rumianowski
Just Ping if someone could help me on that.

2012/11/26 Maciej Rumianowski 

> I failed here. Every place Item with which-id 4040 (EE_FEATURE_LINEBR) is
> created/copied/setWhich is a valid SfxVoidItem with Type() method. Only
> fails in SfxItemSet destructor as below
>
> Program received signal SIGSEGV, Segmentation fault.
>> 0x4496cc33 in SfxItemSet::~SfxItemSet (this=0xbfff51e8,
>> __in_chrg=) at
>> /home/maciej/programowanie/libreoffice/libo/svl/source/items/itemset.cxx:317
>> 317if( (*ppFnd)->Type() == SfxVoidItem::StaticType() )
>>
>> (gdb) call (*ppFnd)->Type()
>> Cannot access memory at address 0xfca0f97
>>
>> typeid.name() returns SfxPoolItem
>
> (gdb) print t1
>> $30 = 0x4213256d "PK11SfxPoolItem"
>>
>
> Any help appreciated
>
> Best Regards
> Maciek
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2012-11-26 Thread Maciej Rumianowski
I failed here. Every place Item with which-id 4040 (EE_FEATURE_LINEBR) is
created/copied/setWhich is a valid SfxVoidItem with Type() method. Only
fails in SfxItemSet destructor as below

Program received signal SIGSEGV, Segmentation fault.
> 0x4496cc33 in SfxItemSet::~SfxItemSet (this=0xbfff51e8,
> __in_chrg=) at
> /home/maciej/programowanie/libreoffice/libo/svl/source/items/itemset.cxx:317
> 317if( (*ppFnd)->Type() == SfxVoidItem::StaticType() )
> (gdb) call (*ppFnd)->Type()
> Cannot access memory at address 0xfca0f97
>
> typeid.name() returns SfxPoolItem

(gdb) print t1
> $30 = 0x4213256d "PK11SfxPoolItem"
>

Any help appreciated

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


Re: Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2012-11-24 Thread Maciej Rumianowski
>
> Ok I lack knowledge about inheritance and what really is called. Above are
> not equal :(
>
(gdb) print (*ppFnd)->StaticType() == (*ppFnd)->Type()
>> $7 = false
>>
>
>
Ok, I have found (maybe) why it is going so. A class that inherits from
SfxPoolItem does not use TYPEINFO() macro and i have to find which one.

Best Regards,
Maciek
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2012-11-22 Thread Maciej Rumianowski
2012/11/22 Maciej Rumianowski 

>
>
> 2012/11/22 Maciej Rumianowski 
>
>> Hi Bjoern,
>>
>> I have hit a problem that i don't fully understand. Disabled items are
>> SfxVoidItem with Which 0, but inserted with different one. State of Item is
>> check with TYPE Macro as below
>>
>>> if ( (*ppFnd)->Type() == TYPE(SfxVoidItem) )
>>> return SFX_ITEM_DISABLED;
>>>
>> I've found the way it compiles and run (below), i will also check if the
> above line is working, tests seem to not touch that code and thats why it
> never crashed.
>
>> if( (*ppFnd)->StaticType() == SfxVoidItem::StaticType() )
>>
>
Ok I lack knowledge about inheritance and what really is called. Above are
not equal :(

> (gdb) print (*ppFnd)->StaticType() == (*ppFnd)->Type()
> $7 = false
>

But why I get error accessing Type() at

> 0x4496cb31 in SfxItemSet::~SfxItemSet (this=0xbfff51e8,
> __in_chrg=) at /home/maciej/programowanie/
>>
>> libreoffice/libo/svl/source/items/itemset.cxx:314
>> 314if( (*ppFnd)->Type() == TYPE(SfxVoidItem) )
>
> Best Regards
Maciek
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2012-11-22 Thread Maciej Rumianowski
2012/11/22 Maciej Rumianowski 

> Hi Bjoern,
>
> I have hit a problem that i don't fully understand. Disabled items are
> SfxVoidItem with Which 0, but inserted with different one. State of Item is
> check with TYPE Macro as below
>
>> if ( (*ppFnd)->Type() == TYPE(SfxVoidItem) )
>> return SFX_ITEM_DISABLED;
>>
> I've found the way it compiles and run (below), i will also check if the
above line is working, tests seem to not touch that code and thats why it
never crashed.

> if( (*ppFnd)->StaticType() == SfxVoidItem::StaticType() )
>

Question about why ISA, IsA, Type are not working remains open.

Best Regards,
Maciek



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


Re: Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2012-11-22 Thread Maciej Rumianowski
Hi Bjoern,

I have hit a problem that i don't fully understand. Disabled items are
SfxVoidItem with Which 0, but inserted with different one. State of Item is
check with TYPE Macro as below

> if ( (*ppFnd)->Type() == TYPE(SfxVoidItem) )
> return SFX_ITEM_DISABLED;
>

So it just type that decides about disabled state of item. I've changed
places where conditions like

> if( !(*ppFnd)->Which() )
>
to

> if ( (*ppFnd)->ISA(SfxVoidItem) )
>
because I saw in an assert that this is used. At this moment problem
started, code compiles but fails at runtime with segfault at
itemset.cxx:313 (line like above)
I've checked with gdb that there is no method ISA, but IsA. With the
changed method to IsA code does not compile.

> (gdb) call (*ppFnd)->IsA(SfxVoidItem)
> $1 = {sal_Bool (const SfxPoolItem * const, TypeId)} 0x44980824
> 
> (gdb) call (*ppFnd)->ISA(SfxVoidItem)
> There is no member or method named ISA.
>
Moreover I tried the way with Type and TYPE with no success, gdb output
below:

> Program received signal SIGSEGV, Segmentation fault.
> 0x4496cb31 in SfxItemSet::~SfxItemSet (this=0xbfff51e8,
> __in_chrg=) at
> /home/maciej/programowanie/libreoffice/libo/svl/source/items/itemset.cxx:314
> 314if( (*ppFnd)->Type() == TYPE(SfxVoidItem) )
> (gdb) call (*ppFnd)->Type()
> Cannot access memory at address 0xfca0f97
> (gdb) call (*ppFnd)->Which()
> $1 = 4040
> (gdb) call (SfxPoolItem *)(*ppFnd)->Type()
> Cannot access memory at address 0xfca0f97
> (gdb) ptype (*ppFnd)
> type = const class SfxPoolItem {
>   private:
> sal_uLong nRefCount;
> sal_uInt16 nWhich;
> sal_uInt16 nKind;
>
> void SetRefCount(sal_uLong);
> void SetKind(sal_uInt16);
>   public:
> sal_uLong AddRef(sal_uLong) const;
>   private:
> sal_uLong ReleaseRef(sal_uLong) const;
> long Delete_Impl(void *);
>   protected:
> SfxPoolItem(sal_uInt16);
> SfxPoolItem(const SfxPoolItem &);
>   public:
> static void * CreateType(void);
> static TypeId StaticType(void);
> static sal_Bool IsOf(TypeId);
> virtual TypeId Type(void) const;
> virtual sal_Bool IsA(TypeId) const;
> ~SfxPoolItem(int);
> void SetWhich(sal_uInt16);
> sal_uInt16 Which(void) const;
> virtual int operator==(const SfxPoolItem &) const;
> int operator!=(const SfxPoolItem &) const;
> virtual int Compare(const SfxPoolItem &) const;
> virtual int Compare(const SfxPoolItem &, const IntlWrapper &) const;
> virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
> SfxMapUnit, SfxMapUnit, String &, const IntlWrapper *) const;
> virtual sal_uInt16 GetVersion(sal_uInt16) const;
> virtual bool ScaleMetrics(long, long);
> virtual bool HasMetrics(void) const;
> virtual bool QueryValue(com::sun::star::uno::Any &, sal_uInt8) const;
> virtual bool PutValue(const com::sun::star::uno::Any &, sal_uInt8);
> virtual SfxPoolItem * Create(SvStream &, sal_uInt16) const;
> virtual SvStream & Store(SvStream &, sal_uInt16) const;
> virtual SfxPoolItem * Clone(SfxItemPool *) const;
> virtual SfxPoolItem * CloneAtWhich(sal_uInt16, SfxItemPool *) const;
> sal_uLong GetRefCount(void) const;
> sal_uInt16 GetKind(void) const;
> static rtl::OUString readByteString(SvStream &);
> static void writeByteString(SvStream &, const rtl::OUString &);
> static rtl::OUString readUnicodeString(SvStream &, bool);
> static void writeUnicodeString(SvStream &, const rtl::OUString &);
>   private:
> SfxPoolItem & operator=(const SfxPoolItem &);
> } *
> (gdb) call (*ppFnd)->StaticType()
> $2 = (void *(*)(void)) 0x4498077e 


Thanks in advance for help :)

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


Bug 34465 - get rid of all calls to virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich)

2012-11-07 Thread Maciej Rumianowski
Hi Björn,

I've started to work on the *Bug
34465*and I have
some questions:

1) What do you suggest to find all places where Put( const SfxPoolItem&,
USHORT nWhich) is used?
I came up with idea to make function private and fix all places where
g++ gives error. Do you have better idea?

2) Is it a good idea to make a special clone method in SfxPoolItem, such as

virtual SfxPoolItem* CloneAtWhich( sal_uInt16 nNewWhich, SfxItemPool
> *pPool = 0 ) const
>  { SfxPoolItem *pItem = Clone( pPool );
> pItem->SetWhich( nNewWhich );
>  return pItem; }
>
Which is used for example in:

diff --git a/sc/source/core/tool/autoform.cxx
> b/sc/source/core/tool/autoform.cxx
> index 14be99e..1dd481c 100644
> --- a/sc/source/core/tool/autoform.cxx
> +++ b/sc/source/core/tool/autoform.cxx
> @@ -672,9 +672,9 @@ void ScAutoFormatData::FillToItemSet( sal_uInt16
> nIndex, SfxItemSet& rItemSet, S
>  }
>  else
>  {
> -rItemSet.Put( rField.GetHeight(), ATTR_CJK_FONT_HEIGHT );
> -rItemSet.Put( rField.GetWeight(), ATTR_CJK_FONT_WEIGHT );
> -rItemSet.Put( rField.GetPosture(), ATTR_CJK_FONT_POSTURE );
> +rItemSet.Put( *(rField.GetHeight().CloneAtWhich(
> ATTR_CJK_FONT_HEIGHT )) );
> +rItemSet.Put( *(rField.GetWeight().CloneAtWhich(
> ATTR_CJK_FONT_WEIGHT )) );
> +rItemSet.Put( *(rField.GetPosture().CloneAtWhich(
> ATTR_CJK_FONT_POSTURE )) );
>  }
>  // do not insert empty CTL font
>  const SvxFontItem& rCTLFont = rField.GetCTLFont();
>

>

Best Regards,
   Maciek
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: JUnit sc_complex fails in Localized enviroment

2012-02-27 Thread Maciej Rumianowski
Dnia 2012-02-27, pon o godzinie 10:58 +, Michael Meeks pisze: 
> Hi there,
> 
> On Sat, 2012-02-25 at 17:52 +0100, Maciej Rumianowski wrote:
> > I hjave discovered a problem when checking libreoffice build (master),
> > below is log. It seems that test is not fully localized.
> 
>   Interesting - what locale are you using out of interest ?
It's pl_PL.UTF-8

>   But I think this problem is unrelated. Can you confirm that this passes
> with a LANG=en_US.UTF8 set ? are you sure it's locale related ? :-)

I have build with pl and de languages and when I set all locale
enviroment variables (LANG LC_*) to en_US.UTF-8 the test uses German
language with output like:

> > Checking an empty cell...
> >   Query column differences
> >   Getting: Tabelle1.C4
> >   Should have been: Sheet1.C4
> > disposing xSheetDoc



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


JUnit sc_complex fails in Localized enviroment

2012-02-25 Thread Maciej Rumianowski
Hi *,

I hjave discovered a problem when checking libreoffice build (master),
below is log. It seems that test is not fully localized.

Is "make check" meant to work in non-English enviroment?

I had once such problem with filters_tests in Calc
(http://nabble.documentfoundation.org/calc-filters-test-problem-in-Localized-enviroment-td3382023.html).
 I don't know How Michael fixed it.

Best Regards,
Maciej Rumianowski 
> maciej@maciej-desktop:~/Dokumenty/LibreOffice-Dev/master/sc$ make -sr -j10 
> /home/maciej/Dokumenty/LibreOffice-Dev/master/workdir/unxlngi6.pro/JunitTest/sc_complex/done
> [ build JUT ] sc_complex
> JUnit version 4.8.2
> .creating a Spreadsheet document
> Getting spreadsheet
> Getting a cell from sheet
> Checking an empty cell...
>   Query column differences
>   Getting: Arkusz1.C4
>   Should have been: Sheet1.C4
> disposing xSheetDoc 
> E.creating a Spreadsheet document
> Getting spreadsheet
> Getting a cell from sheet
> Checking a filled cell...
>   Query column differences
>   Getting: Arkusz1.C4
>   Should have been: Sheet1.C4
> disposing xSheetDoc 
> E
> No core dump at 
> /home/maciej/Dokumenty/LibreOffice-Dev/master/workdir/unxlngi6.pro/JunitTest/sc_complex/user,
>  to create core dumps (and stack traces)
> for crashed soffice instances, enable core dumps with:
> 
>ulimit -c unlimited
> 
> setUpConnection()
> .Creating a Spreadsheet document
> Getting a sheet
> Filling a table
> Getting test objects
> Insert the DataPilotTable
> Starting 'testDataPilotFieldObject'
> test for getName()
> getting the name "Col1"
> ... getName() - OK
> testing setName() ... 
> set the name of object to "Col1X"
> check that container has element with this name
> getting the name "Col1X"
> ... setName() - OK
> Checking 'HasSortInfo'
> Getting: false
> Setting to :true
> Checking 'HasAutoShowInfo'
> Getting: false
> Setting to :true
> Checking 'UseSelectedPage'
> Getting: false
> Setting to :true
> Checking 'HasLayoutInfo'
> Getting: false
> Setting to :true
> Checking 'Subtotals'
> Getting: [Lcom.sun.star.sheet.GeneralFunction;@1acd47
> Setting to :[Lcom.sun.star.sheet.GeneralFunction;@4f459c
> Checking 'LayoutInfo'
> Checking 'IsGroupField'
> Getting: false
> Setting to :true
> Checking 'AutoShowInfo'
> Checking 'SortInfo'
> Checking 'GroupInfo'
> Checking 'Orientation'
> Checking 'Reference'
> Checking 'HasReference'
> Getting: false
> Setting to :true
> Checking 'SelectedPage'
> Getting: 
> Setting to :New
> Checking 'Function'
> Getting: com.sun.star.sheet.GeneralFunction@1f4cbee
> Setting to :com.sun.star.sheet.GeneralFunction@71dc3d
> Checking 'ShowEmpty'
> Getting: true
> Setting to :false
> Bound: none
> Constrained: none
> *** No bound properties found ***
> *** No constrained properties found ***
> *** No bound properties found ***
> *** No constrained properties found ***
> disposing xSheetDoc 
> .Creating a Spreadsheet document
> Getting a sheet
> Filling a table
> Getting test objects
> Insert the DataPilotTable
> Starting 'testDataPilotTableObject'
> test for getName()
> getting the name "DataPilotTable"
> ... getName() - OK
> testing setName() ... 
> set the name of object to "DataPilotTableX"
> check that container has element with this name
> getting the name "DataPilotTableX"
> ... setName() - OK
> getDataPilotFields returned not Null value -- OK
> count of returned fields -- OK
> Field : 'Col1' ... 
>   Column
> Field : 'Col2' ... 
>   Row
> Field : 'Col3' ... 
>   Data
> Field : 'Col4' ... 
>   Hidden
> Field : 'Col5' ... 
>   Page
> getColumnFields
> Fields returned 
>  Col1
>  - OK
> getRowFields
> Fields returned 
>  Col2
>  - OK
> getDataFields
> Fields returned 
>  Col3
>  - OK
> getHiddenFields
> Fields returned 
>  Col4
>  - OK
> getPageFields
> Fields returned 
>  Col5
>  - OK
> disposing xSheetDoc 
> tearDownConnection()
> 
> No core dump at 
> /home/maciej/Dokumenty/LibreOffice-Dev/master/workdir/unxlngi6.pro/JunitTest/sc_complex/user,
>  to create core dumps (and stack traces)
> for crashed soffice instances, enable core dumps with:
> 
>ulimit -c unlimited
> 
> .creating a sheetdocument
> getting sheets
> getting a sheet
> Property 'IsVisible' OK
> old = true
> new = false

[PATCH] EasyHacks fdo#38831 VARARR and VARARR_SORT

2012-02-25 Thread Maciej Rumianowski
Hi *,

small patches partially cleaning svltools from svarrays.

Best Regards,
Maciej Rumianowski
>From 574028e9cef7bfcfc5d7fcaafa075ad1b8e9bb49 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Sat, 25 Feb 2012 14:58:16 +0100
Subject: [PATCH 1/3] Replace VARARR_SORT TESortedPositions with std::set

---
 svtools/source/edit/texteng.cxx |   51 ++
 1 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index 74c4119..5369a68 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -64,6 +64,8 @@
 
 #include 
 
+#include 
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::rtl;
@@ -72,9 +74,6 @@ typedef TextView* TextViewPtr;
 SV_DECL_PTRARR( TextViews, TextViewPtr, 0 )
 // SV_IMPL_PTRARR( TextViews, TextViewPtr );
 
-SV_DECL_VARARR_SORT( TESortedPositions, sal_uLong, 16 )
-SV_IMPL_VARARR_SORT( TESortedPositions, sal_uLong )
-
 #define RESDIFF 10
 #define SCRLRANGE   20  // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop
 
@@ -1822,25 +1821,23 @@ void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos )
 TextNode* pNode = pTEParaPortion->GetNode();
 DBG_ASSERT( pNode->GetText().Len(), "CreateTextPortions sollte nicht fuer leere Absaetze verwendet werden!" );
 
-TESortedPositions aPositions;
-sal_uLong nZero = 0;
-aPositions.Insert( nZero );
+std::set aPositions;
+std::set::iterator aPositionsIt;
+aPositions.insert(0);
 
 sal_uInt16 nAttribs = pNode->GetCharAttribs().Count();
 for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
 {
 TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
 
-// Start und Ende in das Array eintragen...
-// Die InsertMethode laesst keine doppelten Werte zu
-aPositions.Insert( pAttrib->GetStart() );
-aPositions.Insert( pAttrib->GetEnd() );
+aPositions.insert( pAttrib->GetStart() );
+aPositions.insert( pAttrib->GetEnd() );
 }
-aPositions.Insert( pNode->GetText().Len() );
+aPositions.insert( pNode->GetText().Len() );
 
 const TEWritingDirectionInfos& rWritingDirections = pTEParaPortion->GetWritingDirectionInfos();
 for ( sal_uInt16 nD = 0; nD < rWritingDirections.Count(); nD++ )
-aPositions.Insert( rWritingDirections[nD].nStartPos );
+aPositions.insert( rWritingDirections[nD].nStartPos );
 
 if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) )
 {
@@ -1849,7 +1846,7 @@ void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos )
 {
 if ( mpIMEInfos->pAttribs[n] != nLastAttr )
 {
-aPositions.Insert( mpIMEInfos->aPos.GetIndex() + n );
+aPositions.insert( mpIMEInfos->aPos.GetIndex() + n );
 nLastAttr = mpIMEInfos->pAttribs[n];
 }
 }
@@ -1858,8 +1855,8 @@ void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos )
 sal_uInt16 nTabPos = pNode->GetText().Search( '\t', 0 );
 while ( nTabPos != STRING_NOTFOUND )
 {
-aPositions.Insert( nTabPos );
-aPositions.Insert( nTabPos + 1 );
+aPositions.insert( nTabPos );
+aPositions.insert( nTabPos + 1 );
 nTabPos = pNode->GetText().Search( '\t', nTabPos+1 );
 }
 
@@ -1892,21 +1889,21 @@ void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos )
 pTEParaPortion->GetTextPortions().DeleteFromPortion( nInvPortion );
 
 // Eine Portion kann auch durch einen Zeilenumbruch entstanden sein:
-aPositions.Insert( nPortionStart );
+aPositions.insert( nPortionStart );
 
-sal_uInt16 nInvPos;
-#ifdef DBG_UTIL
-sal_Bool bFound =
-#endif
-aPositions.Seek_Entry( nPortionStart, &nInvPos );
-DBG_ASSERT( bFound && ( nInvPos < (aPositions.Count()-1) ), "InvPos ?!" );
-for ( sal_uInt16 i = nInvPos+1; i < aPositions.Count(); i++ )
+aPositionsIt = aPositions.find( nPortionStart );
+DBG_ASSERT( aPositionsIt != aPositions.end(), "nPortionStart not found" );
+
+if ( aPositionsIt != aPositions.end() )
 {
-TETextPortion* pNew = new TETextPortion( (sal_uInt16)aPositions[i] - (sal_uInt16)aPositions[i-1] );
-pTEParaPortion->GetTextPortions().Insert( pNew, pTEParaPortion->GetTextPortions().Count());
+std::set::iterator nextIt = aPositionsIt;
+for ( ++nextIt; nextIt != aPositions.end(); ++aPositionsIt, ++nextIt )
+{
+TETextPortion* pNew = new TETextPortion( *nextIt - *aPositionsIt );
+pTEParaPortion->GetTextPortions().Insert( pNew, pTEParaPortion->GetTextPortions().Count(

Re: [Libreoffice] [PATCH] Replace WW8Bytes with ww::bytes

2011-10-07 Thread Maciej Rumianowski
2011/10/6 Stephan Bergmann 

>
> Btw, &v[0] (as well as &v.front()) are only valid if !v.empty() -- but
> (without checking it in detail right now) I guess the patch already takes
> account of that, Maciej?
>

Yes it does. Mostly it is one function that takes also the size of data.

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


Re: [Libreoffice] [PUSHED] Re: [PATCH] Replace WW8Bytes with ww::bytes

2011-10-07 Thread Maciej Rumianowski
2011/10/7 Jan Holesovsky 

> No need to, I took this approach
>
>
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=f1eda55a0670cd571d676b46d2ac19fe86d51a3f
>
> and modified your patches myself.  I've pushed them under your name, as
> all I did was a sed :-)
>
>
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=6cdc31837c73accca69ed9b1702e269f50c96bff
>
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=37836e3ba37c1ff7c303047a418dcbc3ef390afe
>
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=bcf7d383578a00b961a0484534d810202cf57852
>
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=d052ac384fbb476fe4525ab2d123d79b1158acb4
>

Thanks! I could not get to my development station. Now it looks a lot more
nice.

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


Re: [Libreoffice] [PATCH] Replace WW8Bytes with ww::bytes

2011-10-05 Thread Maciej Rumianowski
Dnia 2011-10-05, śro o godzinie 17:35 +0200, Lubos Lunak pisze:
> On Wednesday 05 of October 2011, Jan Holesovsky wrote:
> > Hi Maciej,
> >
> > On 2011-10-05 at 10:39 +0200, Maciej Rumianowski wrote:
> > > There was a lot of WW8Bytes( SV_DECL_VARARR ) which was partly replaced
> > > with ww::bytes. This set of patches totally migrates code to ww::bytes.
> >
> > Very nice, thank you! :-)
> >
> > Before pushing, I wonder - ww::bytes is std::vector; is there
> > a reason not to make it std::basic_string instead?
> 
>  How about the fact that ww:bytes is not, in fact, a string? At least as far 
> as I can see.
So I did not investigate this, but ww::bytes as vector was there before and 
some methods were prepared already for migration.
I agree that basic_string is strange there.
> > That would allow you to convert the pO->GetData() to something like
> > po->data(), instead of &(*pO)[0] (and similar) used on many places...
> 
>  That same would be allowed by 
> class bytes : public std::vector
> {
> public:
> const sal_uInt8* data() const { return &front(); }
> ...
So if it is desired solution I can modify Patches?

Cheers,
Maciej


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


[Libreoffice] [PATCH] Remove last instance and Finally remove SvULongs

2011-10-02 Thread Maciej Rumianowski
Hi *,

I'm sending 2 patches removing finally SvULongs from LibreOffice:)

Cheers,
Maciej
>From 820bb5c8f68c2cb0219dfa49cacae094c32f62f2 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Fri, 30 Sep 2011 15:55:58 +0200
Subject: [PATCH] Finally remove SvULongs

In all places SvULongs have been replaced with std::vector, now can be totally removed.
---
 svl/inc/svl/svarray.hxx |2 +-
 svl/inc/svl/svstdarr.hxx|7 +--
 svl/source/memtools/svarray.cxx |2 --
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx
index 52b35ac..a0db903 100644
--- a/svl/inc/svl/svarray.hxx
+++ b/svl/inc/svl/svarray.hxx
@@ -81,7 +81,7 @@
 *   Sortierung mit Hilfe der Object-operatoren "<" und "=="
 *
 * JP 09.10.96:  vordefinierte Arrays:
-*   VarArr: SvULongs, SvUShorts
+*   VarArr: SvUShorts
 *   PtrArr: SvStrings, SvStringsDtor
 *   SortArr:SvStringsSort, SvStringsSortDtor,
 *   SvStringsISort, SvStringsISortDtor
diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx
index 2dd5b89..6968cc6 100644
--- a/svl/inc/svl/svstdarr.hxx
+++ b/svl/inc/svl/svstdarr.hxx
@@ -32,7 +32,7 @@
 *   (die defines setzen sich aus "_SVSTDARR_" und dem Namen des Array
 *ohne "Sv" zusammen)
 *
-*   VarArr: SvULongs, SvUShorts
+*   VarArr: SvUShorts
 *   PtrArr: SvStrings, SvStringsDtor
 *   SortArr:SvStringsSort, SvStringsSortDtor,
 *   SvStringsISort, SvStringsISortDtor,
@@ -42,11 +42,6 @@
 #include 
 #include 
 
-#ifndef _SVSTDARR_ULONGS_DECL
-SV_DECL_VARARR_VISIBILITY( SvULongs, sal_uLong, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_ULONGS_DECL
-#endif
-
 #ifndef _SVSTDARR_USHORTS_DECL
 SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC )
 #define _SVSTDARR_USHORTS_DECL
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index bdbadca..88cc111 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -31,7 +31,6 @@
 
 #define _SVARRAY_CXX
 
-#define _SVSTDARR_ULONGS
 #define _SVSTDARR_sal_uInt16S
 #define _SVSTDARR_STRINGS
 #define _SVSTDARR_STRINGSDTOR
@@ -62,7 +61,6 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const
 return ( n >= nA ? USHRT_MAX : n );
 }
 
-SV_IMPL_VARARR( SvULongs, sal_uLong )
 SV_IMPL_VARARR( SvUShorts, sal_uInt16 )
 
 SV_IMPL_PTRARR( SvStrings, StringPtr )
-- 
1.7.4.1

>From f24880f4f444f80b4edcad4740240c9119ea7908 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Fri, 30 Sep 2011 15:39:11 +0200
Subject: [PATCH] Get rid of SvNums

SvNums is a define for SvUShort and SvULong, both are replaced with std::vector
---
 svl/source/items/itemset.cxx |7 ---
 svl/source/items/nranges.cxx |   15 +--
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 0dba305..1a479ad 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -32,10 +32,7 @@
 #include 
 
 #include 
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
 
-#include 
 #include 
 #include 
 #include 
@@ -58,19 +55,15 @@ DBG_NAME(SfxItemSet)
 //
 
 #define NUMTYPE sal_uInt16
-#define SvNums  SvUShorts
 #define SfxNumRangesSfxUShortRanges
 #include "nranges.cxx"
 #undef NUMTYPE
-#undef SvNums
 #undef SfxNumRanges
 
 #define NUMTYPE sal_uLong
-#define SvNums  SvULongs
 #define SfxNumRangesSfxULongRanges
 #include "nranges.cxx"
 #undef NUMTYPE
-#undef SvNums
 #undef SfxNumRanges
 
 //
diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx
index 0b8942c..38b9e01 100644
--- a/svl/source/items/nranges.cxx
+++ b/svl/source/items/nranges.cxx
@@ -29,6 +29,7 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_svl.hxx"
 
+#include 
 // compiled via include from itemset.cxx only!
 
 //
@@ -75,18 +76,20 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *&rpRanges, va_list pArgs,
 {
 NUMTYPE nSize = 0, nIns = 0;
 sal_uInt16 nCnt = 0;
-SvNums aNumArr( 11, 8 );
-aNumArr.Insert( nWh1, nCnt++ );
-aNumArr.Insert( nWh2, nCnt++ );
+std::vector aNumArr;
+aNumArr.push_back( nWh1 );
+aNumArr.push_back( nWh2 );
 DBG_ASSERT( nWh1 <= nWh2, "Ungueltiger Bereich" );
 nSize += nWh2 - nWh1 + 1;
-aNumArr.Insert( nNull, nCnt++ );
+aNumArr.push_back( nNull );
+nCnt = aNumArr.size();
 while ( 0 !=
 ( nIns =
   sal::static_int_cast< NUMTYPE >(
   va_arg( pArgs, NUMTYPE_ARG ) ) ) )
 {
-   

[Libreoffice] calc filters-test problem in Localized enviroment

2011-09-30 Thread Maciej Rumianowski
Hi *,

I am building LibreOffice since July and I have never set any
Localization Options. I don't know if it is necessary for build without
install.

But now Calc's Filter-test fails with such output (DEBUG_CSV_HANDLER is
on)
 
> [ build CXX ] sc/qa/unit/filters-test
> [ build DEP ] LNK:CppunitTest/libtest_sc_filters_test.so
> [ build ALL ] top level modules: sc
> [ build ALL ] loaded modules: sc
> [ build CUT ] sc_ucalc
> [ build LNK ] CppunitTest/libtest_sc_filters_test.so
> [ build CUT ] sc_filters_test
> ods Test
> xls Test
> ods Test
> xls Test
> xlsx Test
> ods Test
> Col: 0 Row: 0
> String: FAŁSZ
> CSVString: FALSE
> result: 0
> ods Test
> ods Test
> Col: 0 Row: 0
> String: 2,00
> CSVString: 2.00
> result: 0
> ods Test
> xls Test
> xlsx Test
> csv_handler.hxx:128:Assertion
> Test name: FiltersTest::testFunctions
> assertion failed
> - Expression: aString == aCSVString
> - content is not correct in cell
> 
> csv_handler.hxx:100:Assertion
> Test name: FiltersTest::testFormats
> assertion failed
> - Expression: aString == aCSVString
> - content is not correct in cell
> 
> Failures !!!
> Run: 9   Failure total: 2   Failures: 2   Errors: 0
> make: *** 
> [/home/maciej/Dokumenty/LibreOffice-Dev/master/workdir/unxlngi6.pro/CppunitTest/sc_filters_test.test]
>  Błąd 1

FAŁSZ is Polish FALSE ;)

Cheers,
Maciej

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


Re: [Libreoffice] Build Error - Graphite2-1.0.3

2011-09-29 Thread Maciej Rumianowski
Dnia 2011-09-29, czw o godzinie 10:29 +0200, Maciej Rumianowski pisze:
> Hi,
> 
> I have encountered an error while building latest source.
> 
> 
> > =
> > (1/1) Building module graphite
> > =
> > Entering /home/maciej/Dokumenty/LibreOffice-Dev/master/graphite
> > 
> > Compiling: 
> > libgraphite2_off/unxlngi6.pro/misc/build/graphite2-1.0.3/src/direct_machine.cpp
> > Compiling: 
> > libgraphite2_off/unxlngi6.pro/misc/build/graphite2-1.0.3/src/gr_features.cpp
> > Compiling: 
> > libgraphite2_off/unxlngi6.pro/misc/build/graphite2-1.0.3/src/gr_face.cpp
> > Compiling: 
> > libgraphite2_off/unxlngi6.pro/misc/build/graphite2-1.0.3/src/gr_font.cpp
> > dmake:  Error: -- `processUTF.h' not found, and can't be made
> > dmake:  Error code 255, while making 
> > './unxlngi6.pro/misc/build/so_built_libgraphite'
> 
> I have checked there is no processUTF.h in
> http://dev-www.libreoffice.org/src/3bf481ca95109b14435125c0dd1f2217-graphite2-1.0.3.tgz
>  
> but is in 
> http://dev-www.libreoffice.org/src/3115c721f5cb7c464f01c2dddccfaba6-graphite2-1.0.2.tgz

"make clean" helped, but shouldn't it be automatically done after new
version is downloaded.

Cheers,
Maciej


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


Re: [Libreoffice] [PATCH][PUSHED] Replace-SvULongs-with-std-vector-in-sfx2

2011-09-29 Thread Maciej Rumianowski
Hi David,
> > @@ -53,7 +54,7 @@ TYPEINIT1_FACTORY( SvxClipboardFmtItem, SfxPoolItem , new 
> >  SvxClipboardFmtItem(0
> >  SvxClipboardFmtItem_Impl::SvxClipboardFmtItem_Impl(
> >  const SvxClipboardFmtItem_Impl& rCpy )
> >  {
> > -aFmtIds.Insert( &rCpy.aFmtIds, 0 );
> > +std::copy(rCpy.aFmtIds.begin(), rCpy.aFmtIds.end(), aFmtIds.begin());
> >  for( sal_uInt16 n = 0, nEnd = rCpy.aFmtNms.Count(); n < nEnd; ++n )
> >  {
> >  String* pStr = rCpy.aFmtNms[ n ];
> 
> This is totally wrong! The original line _inserts_ all items from
> rCpy.aFmtIds at the beginning of aFmtIds. std::copy _overwrites_ the
> first n elements of aFmtIds by items from the given range--this requires
> that aFmtIds has sufficient size. Since this is constructor, aFmtIds is
> always empty, therefore the line is practically guaranteed to corrupt
> memory (unless rCpy.aFmtIds is empty). I changed it to simple copy
> construction of aFmtIds from rCpy.aFmtIds.
Thanks, sorry for that. I thought if I am working on vector than i will
automatically resize, but I missed in description that I have to
manually resize.

Cheers,
Maciej

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


[Libreoffice] Build Error - Graphite2-1.0.3

2011-09-29 Thread Maciej Rumianowski
Hi,

I have encountered an error while building latest source.


> =
> (1/1) Building module graphite
> =
> Entering /home/maciej/Dokumenty/LibreOffice-Dev/master/graphite
> 
> Compiling: 
> libgraphite2_off/unxlngi6.pro/misc/build/graphite2-1.0.3/src/direct_machine.cpp
> Compiling: 
> libgraphite2_off/unxlngi6.pro/misc/build/graphite2-1.0.3/src/gr_features.cpp
> Compiling: 
> libgraphite2_off/unxlngi6.pro/misc/build/graphite2-1.0.3/src/gr_face.cpp
> Compiling: 
> libgraphite2_off/unxlngi6.pro/misc/build/graphite2-1.0.3/src/gr_font.cpp
> dmake:  Error: -- `processUTF.h' not found, and can't be made
> dmake:  Error code 255, while making 
> './unxlngi6.pro/misc/build/so_built_libgraphite'

I have checked there is no processUTF.h in
http://dev-www.libreoffice.org/src/3bf481ca95109b14435125c0dd1f2217-graphite2-1.0.3.tgz
 
but is in 
http://dev-www.libreoffice.org/src/3115c721f5cb7c464f01c2dddccfaba6-graphite2-1.0.2.tgz

Cheers,
Maciej

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


[Libreoffice] [PATCH] Replace-SvULongs-with-std-vector-in-sfx2

2011-09-27 Thread Maciej Rumianowski
Hi *,

Simple Patch replacing SvULongs with std::vector. Related Bug 38831.

Cheers,
Maciej
>From 6e3f88f2673c507ce2f3d9ab4bdc92c8be75bd0a Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Tue, 27 Sep 2011 22:04:20 +0200
Subject: [PATCH] Replace SvULongs with std::vector in sfx2

Bug 38831, replace SvULongs with std::vector in sfx2 and related svtools
---
 sfx2/inc/sfx2/frmhtml.hxx |1 -
 sfx2/source/bastyp/frmhtml.cxx|4 
 sfx2/source/bastyp/sfxhtml.cxx|   18 --
 sfx2/source/control/dispatch.cxx  |   12 +---
 sfx2/source/doc/docfile.cxx   |   13 ++---
 svtools/inc/svtools/parhtml.hxx   |4 +---
 svtools/source/svhtml/parhtml.cxx |   21 +++--
 svx/source/items/clipfmtitem.cxx  |   17 +
 8 files changed, 36 insertions(+), 54 deletions(-)

diff --git a/sfx2/inc/sfx2/frmhtml.hxx b/sfx2/inc/sfx2/frmhtml.hxx
index b365ab9..6f88b43 100644
--- a/sfx2/inc/sfx2/frmhtml.hxx
+++ b/sfx2/inc/sfx2/frmhtml.hxx
@@ -38,7 +38,6 @@
 class SfxFrameHTMLParser;
 class _SfxFrameHTMLContexts;
 class SfxFrameSetObjectShell;
-class SvULongs;
 class SfxMedium;
 namespace svtools { class AsynchronLink; }
 
diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx
index 75cd28b..12cbe09 100644
--- a/sfx2/source/bastyp/frmhtml.cxx
+++ b/sfx2/source/bastyp/frmhtml.cxx
@@ -33,10 +33,6 @@
 #include 
 #include 
 
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
-#include 
-
 #include 
 
 #include 
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 002e2ce..a887640 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -42,10 +42,6 @@
 #include 
 #include 
 #include 
-#ifndef _SVSTDARR_ULONGS_DECL
-#define _SVSTDARR_ULONGS
-#include 
-#endif
 #include 
 #include 
 #include 
@@ -54,6 +50,8 @@
 
 #include 
 
+#include 
+
 
 using namespace ::com::sun::star;
 
@@ -128,7 +126,7 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBaseUR
 DBG_ASSERT( pImageMap, "ParseAreaOptions: no Image-Map" );
 
 sal_uInt16 nShape = IMAP_OBJ_RECTANGLE;
-SvULongs aCoords;
+std::vector aCoords;
 String aName, aHRef, aAlt, aTarget, sEmpty;
 sal_Bool bNoHRef = sal_False;
 SvxMacroTableDtor aMacroTbl;
@@ -147,7 +145,7 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBaseUR
 rOption.GetEnum( nShape, aAreaShapeOptEnums );
 break;
 case HTML_O_COORDS:
-rOption.GetNumbers( aCoords, sal_True );
+rOption.GetNumbers( aCoords, true );
 break;
 case HTML_O_HREF:
 aHRef = INetURLObject::GetAbsURL( rBaseURL, rOption.GetString() );
@@ -195,7 +193,7 @@ IMAPOBJ_SETEVENT:
 switch( nShape )
 {
 case IMAP_OBJ_RECTANGLE:
-if( aCoords.Count() >=4 )
+if( aCoords.size() >=4 )
 {
 Rectangle aRec( aCoords[0], aCoords[1],
 aCoords[2], aCoords[3] );
@@ -207,7 +205,7 @@ IMAPOBJ_SETEVENT:
 }
 break;
 case IMAP_OBJ_CIRCLE:
-if( aCoords.Count() >=3 )
+if( aCoords.size() >=3 )
 {
 Point aPoint( aCoords[0], aCoords[1] );
 IMapCircleObject aMapCObj( aPoint, aCoords[2],aHRef, aAlt, String(),
@@ -218,9 +216,9 @@ IMAPOBJ_SETEVENT:
 }
 break;
 case IMAP_OBJ_POLYGON:
-if( aCoords.Count() >=6 )
+if( aCoords.size() >=6 )
 {
-sal_uInt16 nCount = aCoords.Count() / 2;
+sal_uInt16 nCount = aCoords.size() / 2;
 Polygon aPoly( nCount );
 for( sal_uInt16 i=0; i
 #include   // due to bsearch
 
-#define _SVSTDARR_ULONGS
-#include 
 #include 
 #include 
 #include 
@@ -152,7 +150,7 @@ struct SfxDispatcher_Impl
 sal_Bool*   pInCallAliveFlag;   // view the Destructor Stack
 SfxObjectBars_Impl   aObjBars[SFX_OBJECTBAR_MAX];
 SfxObjectBars_Impl   aFixedObjBars[SFX_OBJECTBAR_MAX];
-SvULongs aChildWins;
+std::vector aChildWins;
 sal_uInt16   nActionLevel;  // in EnterAction
 sal_uInt32   nEventId;  // EventId UserEvent
 sal_Bool bUILocked; // Update disconnected (no flicker)
@@ -831,11 +829,11 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
 SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl();
 if ( pWorkWin )
 {
-for (sal_uInt16 n=0; naChildWins.Count();)
+for (size_t n=0; naChildWins.size();)
 {
 SfxChildWindow *pWin = pWorkWin->GetChildWindow_Impl( (sal_uInt16) ( pImp->aChildWins[n] & 0x ) );
 if (!pWin || (pWin && pWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT))
-pImp->aChil

[Libreoffice] [PATCH] Re: Replace SvULongs and SvUShorts in svx with std::vector

2011-09-27 Thread Maciej Rumianowski
Marking as PATCH. Might got lost.

Cheers
Maciej


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


[Libreoffice] Replace SvULongs and SvUShorts in svx with std::vector

2011-09-21 Thread Maciej Rumianowski
Hi,

This is another one patch replacing SvULongs and SvUShorts with
std::vector.

Cheers,
Maciej
>From 06db1aa6489e2fac7b088f30fe6cd85629c7ef08 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Wed, 21 Sep 2011 09:19:50 +0200
Subject: [PATCH] Replace SvULongs and SVUShorts with std::vector

Replace SvULongs with std::vector and SvUShorts with std::vector
---
 svx/inc/svx/numfmtsh.hxx   |8 +--
 svx/source/dialog/fntctrl.cxx  |   24 +
 svx/source/fmcomp/fmgridcl.cxx |   44 
 svx/source/items/numfmtsh.cxx  |   28 
 4 files changed, 47 insertions(+), 57 deletions(-)

diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx
index c29f71d..1fc0d7e 100644
--- a/svx/inc/svx/numfmtsh.hxx
+++ b/svx/inc/svx/numfmtsh.hxx
@@ -33,12 +33,6 @@
 #include 
 #include 
 
-#ifndef _SVSTDARR_ULONGS
-#define _SVSTDARR_ULONGS
-#endif
-#ifndef _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTS
-#endif
 #ifndef _SVSTDARR_STRINGS
 #define _SVSTDARR_STRINGS
 #endif
@@ -237,7 +231,7 @@ private:
 sal_uInt32  nCurFormatKey;
 short   nCurCategory;
 LanguageTypeeCurLanguage;
-SvUShorts   aCurCurrencyList;
+std::vector aCurCurrencyList;
 NfCurrencyEntry*pCurCurrencyEntry;
 boolbBankingSymbol;
 sal_uInt16  nCurCurrencyEntryPos;
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 38be3d8..923a234 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -43,11 +43,10 @@
 #include 
 
 #ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
 #define _SVSTDARR_XUB_STRLEN
 #include 
 #endif
+#include 
 #include 
 
 #include 
@@ -149,9 +148,9 @@ class FontPrevWin_Impl
 sal_BoolbDelPrinter;
 
 Reference < XBreakIterator >xBreak;
-SvULongsaTextWidth;
+std::vectoraTextWidth;
 SvXub_StrLens   aScriptChg;
-SvUShorts   aScriptType;
+std::vector aScriptType;
 SvxFont aCJKFont;
 SvxFont aCTLFont;
 String  aText;
@@ -248,14 +247,11 @@ inline sal_Bool FontPrevWin_Impl::Is100PercentFontWidthValid() const
 void FontPrevWin_Impl::_CheckScript()
 {
 aScriptText = aText;
-size_t nCnt = aScriptChg.size();
-if( nCnt )
-{
-aScriptChg.clear();
-aScriptType.Remove( 0, nCnt );
-aTextWidth.Remove( 0, nCnt );
-nCnt = 0;
-}
+
+aScriptChg.clear();
+aScriptType.clear();
+aTextWidth.clear();
+
 if( !xBreak.is() )
 {
 Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
@@ -297,8 +293,8 @@ void FontPrevWin_Impl::_CheckScript()
 {
 aScriptChg.push_back( nChg );
 }
-aScriptType.Insert( nScript, nCnt );
-aTextWidth.Insert( sal_uIntPtr(0), nCnt++ );
+aScriptType.push_back( nScript );
+aTextWidth.push_back( 0 );
 
 if( nChg < aText.Len() )
 nScript = xBreak->getScriptType( aText, nChg );
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 2837df8..0f1b0df 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -454,47 +454,47 @@ IMPL_LINK( FmGridHeader, OnAsyncExecuteDrop, void*, /*NOTINTERESTEDIN*/ )
 sal_uInt16 nPos = GetModelColumnPos(nColId);
 Reference< XPropertySet >  xCol, xSecondCol;
 
-// erzeugen der Column in abhaengigkeit vom type, default textfeld
-SvULongs aPossibleTypes;
+// Create Column based on type, default textfield
+std::vector aPossibleTypes;
 switch (nDataType)
 {
 case DataType::BIT:
 case DataType::BOOLEAN:
-aPossibleTypes.Insert(SID_FM_CHECKBOX, aPossibleTypes.Count());
+aPossibleTypes.push_back(SID_FM_CHECKBOX);
 break;
 case DataType::TINYINT:
 case DataType::SMALLINT:
 case DataType::INTEGER:
-aPossibleTypes.Insert(SID_FM_NUMERICFIELD, aPossibleTypes.Count());
-aPossibleTypes.Insert(SID_FM_FORMATTEDFIELD, aPossibleTypes.Count());
+aPossibleTypes.push_back(SID_FM_NUMERICFIELD);
+aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD);
 break;
 case DataType::REAL:
 case DataType::DOUBLE:
 case DataType::NUMERIC:
 case DataType::DECIMAL:
-aPossibleTypes.Insert(SID_FM_FORMATTEDFIELD, aPossibleTypes.Count());
-aPossibleTypes.Insert(SID_FM_NUMERICFIELD, aPossibleTypes.Count());
+aPossibleTypes.push

[Libreoffice] [PATCH] Use STL find in SvxNumberFormatShell

2011-08-10 Thread Maciej Rumianowski
Hi,

My patch got lost on mailing list, so I am attaching it now against
actual master.

Discussion was here
http://lists.freedesktop.org/archives/libreoffice/2011-August/016218.html

Best Regards,
Maciej
>From 63ca5f6af27123f821446e39eaa4b152652eec7f Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Tue, 9 Aug 2011 01:15:16 +0200
Subject: [PATCH] Use STL find() in SvxNumberFormatShell

With SvULongs replaced by std::vector std::find can be used in IsRemoved_Impl IsAdded_Impl
---
 svx/inc/svx/numfmtsh.hxx  |9 --
 svx/source/items/numfmtsh.cxx |   63 +++--
 2 files changed, 29 insertions(+), 43 deletions(-)

diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx
index 5217e29..c29f71d 100644
--- a/svx/inc/svx/numfmtsh.hxx
+++ b/svx/inc/svx/numfmtsh.hxx
@@ -256,9 +256,12 @@ private:
 SVX_DLLPRIVATE shortFillEListWithSysCurrencys( SvStrings& rList,short nSelPos);
 SVX_DLLPRIVATE shortFillEListWithUserCurrencys( SvStrings& rList,short nSelPos);
 
-SVX_DLLPRIVATE shortFillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 nPrivCat, short Pos );
-SVX_DLLPRIVATE bool IsRemoved_Impl( sal_uInt32 nKey );
-SVX_DLLPRIVATE bool IsAdded_Impl( sal_uInt32 nKey );
+SVX_DLLPRIVATE short   FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 nPrivCat, short Pos );
+SVX_DLLPRIVATE ::std::vector::iterator GetRemoved_Impl( size_t nKey );
+SVX_DLLPRIVATE boolIsRemoved_Impl( size_t nKey );
+SVX_DLLPRIVATE ::std::vector::iterator GetAdded_Impl( size_t nKey );
+SVX_DLLPRIVATE boolIsAdded_Impl( size_t nKey );
+
 SVX_DLLPRIVATE void GetPreviewString_Impl( String& rString,
Color*& rpColor );
 SVX_DLLPRIVATE void PosToCategory_Impl( sal_uInt16 nPos, short& rCategory );
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index b06042b..c759768 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -255,20 +255,9 @@ bool SvxNumberFormatShell::AddFormat( String& rFormat,  xub_StrLen& rErrPos,
 
 if ( nAddKey != NUMBERFORMAT_ENTRY_NOT_FOUND ) // bereits vorhanden?
 {
-if ( IsRemoved_Impl( nAddKey ) )
+::std::vector::iterator nAt = GetRemoved_Impl( nAddKey );
+if ( nAt != aDelList.end() )
 {
-boolbFound  = false;
-std::vector::iterator nAt = aDelList.begin();
-
-for (std::vector::iterator it(aDelList.begin()); !bFound && it != aDelList.end(); ++it )
-{
-if ( *it == nAddKey )
-{
-bFound  = true;
-nAt = it;
-}
-}
-DBG_ASSERT( bFound, "Key not found" );
 aDelList.erase( nAt );
 bInserted = true;
 }
@@ -340,22 +329,10 @@ bool SvxNumberFormatShell::RemoveFormat( const String&  rFormat,
 {
 aDelList.push_back( nDelKey );
 
-if ( IsAdded_Impl( nDelKey ) )
+::std::vector::iterator nAt = GetAdded_Impl( nDelKey );
+if( nAt != aAddList.end() )
 {
-bool bFound = false;
-std::vector::iterator nAt = aAddList.begin();
-
-for ( std::vector::iterator it(aAddList.begin()); !bFound && it != aAddList.end(); ++it )
-{
-if ( *it == nDelKey )
-{
-bFound = true;
-nAt = it;
-}
-}
-DBG_ASSERT( bFound, "Key not found" );
-if( bFound )
-aAddList.erase( nAt );
+aAddList.erase( nAt );
 }
 
 nCurCategory=pFormatter->GetType(nDelKey);
@@ -1178,24 +1155,30 @@ void SvxNumberFormatShell::GetPreviewString_Impl( String& rString, Color*& rpCol
 
 // ---
 
-bool SvxNumberFormatShell::IsRemoved_Impl( sal_uInt32 nKey )
+::std::vector::iterator SvxNumberFormatShell::GetRemoved_Impl( size_t nKey )
 {
-bool bFound = false;
-for (std::vector::const_iterator it(aDelList.begin()); !bFound && it != aDelList.end(); ++it )
-if ( *it == nKey )
-bFound = true;
-return bFound;
+return ::std::find(aDelList.begin(), aDelList.end(), nKey);
 }
 
 // ---
 
-bool SvxNumberFormatShell::IsAdded_Impl( sal_uInt32 nKey )
+bool SvxNumberFormatShell::IsRemoved_Impl( size_t nKey )
+{
+return GetRemoved_Impl( nKey ) != aDelList.end();
+}
+
+// ---
+
+::std::vector::ite

[Libreoffice] [PATCH] Use STL find() in SvxNumberFormatShell

2011-08-08 Thread Maciej Rumianowski
Hi Eike,
Dnia 2011-08-07, nie o godzinie 21:31 +0200, Eike Rathke pisze:
> 
> I suggest
> 
> ::std::vector::iterator GetAdded_Impl( size_t nKey );
> 
> with logically the content of IsAdded_Impl() but using ::std::find()
> instead of the awkward loop and returning the position's iterator that
> can be used in RemoveFormat(), plus
> 
> bool IsAdded_Impl( size_t nKey )
> {
> return GetAdded_Impl( nKey) != aAddList.end();
> }
> 
> for all other places that need only a bool to remain the same. 

As promised I have done this :)

Best,
Maciej
>From 3e1925dec379e88832594b3f6032df1ca6569026 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Tue, 9 Aug 2011 01:15:16 +0200
Subject: [PATCH] Use STL find() in SvxNumberFormatShell

With SvULongs replaced by std::vector std::find can be used in IsRemoved_Impl IsAdded_Impl
---
 svx/inc/svx/numfmtsh.hxx  |8 +++--
 svx/source/items/numfmtsh.cxx |   63 +++--
 2 files changed, 28 insertions(+), 43 deletions(-)

diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx
index 4366e93..20970f3 100644
--- a/svx/inc/svx/numfmtsh.hxx
+++ b/svx/inc/svx/numfmtsh.hxx
@@ -256,9 +256,11 @@ private:
 SVX_DLLPRIVATE shortFillEListWithSysCurrencys( SvStrings& rList,short nSelPos);
 SVX_DLLPRIVATE shortFillEListWithUserCurrencys( SvStrings& rList,short nSelPos);
 
-SVX_DLLPRIVATE shortFillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 nPrivCat, short Pos );
-SVX_DLLPRIVATE sal_Bool IsRemoved_Impl( sal_uInt32 nKey );
-SVX_DLLPRIVATE sal_Bool IsAdded_Impl( sal_uInt32 nKey );
+SVX_DLLPRIVATE short   FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 nPrivCat, short Pos );
+SVX_DLLPRIVATE ::std::vector::iterator GetRemoved_Impl( size_t nKey );
+SVX_DLLPRIVATE boolIsRemoved_Impl( size_t nKey );
+SVX_DLLPRIVATE ::std::vector::iterator GetAdded_Impl( size_t nKey );
+SVX_DLLPRIVATE boolIsAdded_Impl( size_t nKey );
 SVX_DLLPRIVATE void GetPreviewString_Impl( String& rString,
Color*& rpColor );
 SVX_DLLPRIVATE void PosToCategory_Impl( sal_uInt16 nPos, short& rCategory );
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index bcbf8c7..e6fb543 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -255,20 +255,9 @@ sal_Bool SvxNumberFormatShell::AddFormat( String& rFormat,  xub_StrLen& rErrPos,
 
 if ( nAddKey != NUMBERFORMAT_ENTRY_NOT_FOUND ) // bereits vorhanden?
 {
-if ( IsRemoved_Impl( nAddKey ) )
+::std::vector::iterator nAt = GetRemoved_Impl( nAddKey );
+if ( nAt != aDelList.end() )
 {
-sal_BoolbFound  = sal_False;
-std::vector::iterator nAt = aDelList.begin();
-
-for (std::vector::iterator it(aDelList.begin()); !bFound && it != aDelList.end(); ++it )
-{
-if ( *it == nAddKey )
-{
-bFound  = sal_True;
-nAt = it;
-}
-}
-DBG_ASSERT( bFound, "Key not found" );
 aDelList.erase( nAt );
 bInserted = sal_True;
 }
@@ -340,22 +329,10 @@ sal_Bool SvxNumberFormatShell::RemoveFormat( const String&  rFormat,
 {
 aDelList.push_back( nDelKey );
 
-if ( IsAdded_Impl( nDelKey ) )
+::std::vector::iterator nAt = GetAdded_Impl( nDelKey );
+if( nAt != aAddList.end() )
 {
-bool bFound = false;
-std::vector::iterator nAt = aAddList.begin();
-
-for ( std::vector::iterator it(aAddList.begin()); !bFound && it != aAddList.end(); ++it )
-{
-if ( *it == nDelKey )
-{
-bFound = true;
-nAt = it;
-}
-}
-DBG_ASSERT( bFound, "Key not found" );
-if( bFound )
-aAddList.erase( nAt );
+aAddList.erase( nAt );
 }
 
 nCurCategory=pFormatter->GetType(nDelKey);
@@ -1178,24 +1155,30 @@ void SvxNumberFormatShell::GetPreviewString_Impl( String& rString, Color*& rpCol
 
 // ---
 
-sal_Bool SvxNumberFormatShell::IsRemoved_Impl( sal_uInt32 nKey )
+::std::vector::iterator SvxNumberFormatShell::GetRemoved_Impl( size_t nKey )
 {
-sal_Bool bFound = sal_False;
-for (std::vector::const_iterator it(aDelList.begin()); !bFound && it != aDelList.end(); +

Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-07 Thread Maciej Rumianowski
Dnia 2011-08-07, nie o godzinie 21:31 +0200, Eike Rathke pisze:
> I suggest
> 
> ::std::vector::iterator GetAdded_Impl( size_t nKey );
> 
> with logically the content of IsAdded_Impl() but using ::std::find()
> instead of the awkward loop and returning the position's iterator that
> can be used in RemoveFormat(), plus
> 
> bool IsAdded_Impl( size_t nKey )
> {
> return GetAdded_Impl( nKey) != aAddList.end();
> }
> 
> for all other places that need only a bool to remain the same.

Okay.


> > in next patch I will try to change short to appropriate type and in other 
> > places try to use size_t.
> 
> Take care not to touch too much, some of the short type seems to evolve
> from the list box using that type for position of elements. I think it
> doesn't pay to be overly aggressive there.

So I have tried to do this, but it is like Domino.


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


Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-07 Thread Maciej Rumianowski
Hi Eike,

Dnia 2011-08-07, nie o godzinie 11:17 +0200, Eike Rathke pisze:
> You're right, the code is "suboptimal" ... in fact IsRemoved_Impl()
> and
> IsAdded_Impl() could also return the index of the element found so it
> wouldn't be needed to be searched again. Want to take care of it? 

Yes :) My proposition of new declaration

> bool IsAdded_Impl( size_t nKey, size_t* nFoundKey );

I am attaching corrected patch, without this change and without size_t.
I have casted variables to size_t, in next patch I will try to change short to 
appropriate type and in other places try to use size_t.

Best Regards,
Maciej

>From ba07b8f694f9736b9c43dc3f0a34d1248d8fcd77 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Sun, 7 Aug 2011 16:46:17 +0200
Subject: [PATCH] Replace SvULongs with vector and code clean up

Instead of SvULongs use std::vector
replace sal_Bool with bool where variable is not interfering with return value
---
 cui/source/tabpages/numfmt.cxx |2 +-
 svx/inc/svx/numfmtsh.hxx   |   10 ++-
 svx/source/items/numfmtsh.cxx  |  186 +---
 3 files changed, 85 insertions(+), 113 deletions(-)

diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 0295c32..8320b5d 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -782,7 +782,7 @@ sal_Bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
 // --
 // List of changed user defined formats:
 // -
-const sal_uInt32 nDelCount = pNumFmtShell->GetUpdateDataCount();
+const size_t nDelCount = pNumFmtShell->GetUpdateDataCount();
 
 if ( nDelCount > 0 )
 {
diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx
index a9253c0..e15d562 100644
--- a/svx/inc/svx/numfmtsh.hxx
+++ b/svx/inc/svx/numfmtsh.hxx
@@ -46,6 +46,8 @@
 
 #include 
 
+#include 
+
 // forward ---
 
 class Color;
@@ -183,7 +185,7 @@ public:
 sal_BoolFindEntry( const String& rFmtString, sal_uInt32* pAt = NULL );
 
 voidValidateNewEntries( sal_Bool bValidate = sal_True ) { bUndoAddList = !bValidate; }
-sal_uInt32  GetUpdateDataCount() const;
+size_t GetUpdateDataCount() const;
 voidGetUpdateData( sal_uInt32* pDelArray, const sal_uInt32 nSize );
 
 voidSetCurNumFmtKey( sal_uInt32 nNew )  { nCurFormatKey = nNew; }
@@ -228,9 +230,9 @@ private:
 String  aValStr;
 double  nValNum;
 sal_BoolbUndoAddList;
-SvULongsaAddList;
-SvULongsaDelList;
-SvULongsaCurEntryList;
+std::vector aAddList;
+std::vector aDelList;
+std::vector aCurEntryList;
 sal_uInt32  nInitFormatKey;
 sal_uInt32  nCurFormatKey;
 short   nCurCategory;
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 7b106ae..f799214 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -159,38 +159,32 @@ SvxNumberFormatShell::~SvxNumberFormatShell()
 // Hinzugefuegte Formate sind nicht gueltig:
 // => wieder entfernen:
 
-for ( sal_uInt16 i = 0; i < aAddList.Count(); ++i )
-pFormatter->DeleteEntry( aAddList[i] );
+for ( std::vector::const_iterator it(aAddList.begin()); it != aAddList.end(); ++it )
+pFormatter->DeleteEntry( *it );
 }
 
-//
-// Add-/Remove-Listen leerraeumen:
-//
-aAddList.Remove( 0, aAddList.Count() );
-aDelList.Remove( 0, aAddList.Count() );
-
 if(aCurrencyFormatList.Count()>0)
 aCurrencyFormatList.DeleteAndDestroy(0,aCurrencyFormatList.Count());
 }
 
 // ---
 
-sal_uInt32 SvxNumberFormatShell::GetUpdateDataCount() const
+size_t SvxNumberFormatShell::GetUpdateDataCount() const
 {
-return aDelList.Count();
+return aDelList.size();
 }
 
 // ---
 
 void SvxNumberFormatShell::GetUpdateData( sal_uInt32* pDelArray, const sal_uInt32 nSize )
 {
-const sal_uInt32 nCount = aDelList.Count();
+const size_t nListSize = aDelList.size();
 
-DBG_ASSERT( pDelArray && ( nSize == nCount ), "Array nicht initialisiert!" );
+DBG_ASSERT( pDelArray && ( nSize == nListSize ), "Array nicht initialisiert!" );
 
-if ( pDelArray && ( nSize == nCount ) )
-for ( sal_uInt16 i = 0; i < aDelList.Count(); ++i )
-*pDelArray++ = aDelList[i];
+if ( pDe

Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-06 Thread Maciej Rumianowski
Hi Eike,

Thanks for review!

Dnia 2011-08-06, sob o godzinie 17:35 +0200, Eike Rathke pisze:
> 
> >  {
> > -if ( aDelList[i] == nAddKey )
> > +if ( *it == nAddKey )
> >  {
> >  bFound   = sal_True;
> > -nAt  = i;
> > +nAt  = it;
> >  }
> >  }
> >  DBG_ASSERT( bFound, "Key not found" );
> > -aDelList.Remove( nAt );
> > +aDelList.erase( nAt );
> 
> Hmm.. I'd say the original code was wrong, when nAddKey was not found
> in
> aDelList it removed the first element anyway. That should be
> 
>if (bFound)
>aDelList.erase( nAt );
> 
> instead. 
There was so many questions that I forgot to ask. Should this code be
more changed? Because code in if(isRemoved_Impl()) is only entered if
there is nAddKey in aDelList. My question is why the key is double
searched? I think assertion will never be met.

Best Regards,
Maciej

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


[Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-06 Thread Maciej Rumianowski
Hi,

I was working on SvULongs in libs-core and I decided to split my work in
several Patches.

With this patch comes some questions:
> @@ -159,16 +159,10 @@ SvxNumberFormatShell::~SvxNumberFormatShell()
>  // Hinzugefuegte Formate sind nicht gueltig:
>  // => wieder entfernen:
> 
> -for ( sal_uInt16 i = 0; i < aAddList.Count(); ++i )
> -pFormatter->DeleteEntry( aAddList[i] );
> +for ( std::vector::const_iterator it =
> aAddList.begin(); it != aAddList.end(); ++it )
> +pFormatter->DeleteEntry( *it );
>  }
> 
> -//
> -// Add-/Remove-Listen leerraeumen:
> -//
> -aAddList.Remove( 0, aAddList.Count() );
> -aDelList.Remove( 0, aAddList.Count() );

1. It is not necessary to explicitly clear vectors?

> @@ -1279,21 +1272,6 @@ void
> SvxNumberFormatShell::MakePrevStringFromVal(
>  pFormatter->GetPreviewString( rFormatStr, nValue, rPreviewStr,
> &rpFontColor, eCurLanguage );
> }
> 
> -/*
> -#* Member: GetComment4Entry Datum:30.10.97
> -#*
> -#*
> -#*  Klasse: SvxNumberFormatShell
> -#*
> -#*  Funktion: Liefert den Kommentar fuer einen gegebenen
> -#* Eintrag zurueck.
> -#*
> -#*  Input: Nummer des Eintrags
> -#*
> -#* Output: Kommentar-String
> -#*
> -#/
> -
> void SvxNumberFormatShell::SetComment4Entry(short nEntry,String
> aEntStr)
> {
>  SvNumberformat *pNumEntry;

2. Is it useful to translate comments like this? and convert to actual
documentation style?
Tranlation:
"Funktion:  Liefert den Kommentar fuer einen gegebenen Eintrag zurueck."
- Returns a comment for given Entry
"Input: Nummer des Eintrags" - Number of entry
"Output:Kommentar-String" - Comment's string

> @@ -228,9 +229,9 @@ private:
>  String aValStr;
>  double nValNum;
>  sal_Bool bUndoAddList;
> -SvULongs aAddList;
> -SvULongs aDelList;
> -SvULongs aCurEntryList;
> +std::vector aAddList;
> +std::vector aDelList;
> +std::vector aCurEntryList;
3. For code formating tabs are okay? I have used spaces, but previous
there were tabs.

> @@ -229,21 +224,18 @@ void SvxNumberFormatShell::FormatChanged( sal_uInt16  
> nFmtLbPos,
>String& rPreviewStr,
>Color*& rpFontColor )
>  {
> -//nCurFormatKey = pCurFmtTable->GetKey( pCurFmtTable->GetObject( 
> nFmtLbPos ) );
> -
4. If there is commented code should it be removed?


> @@ -1325,7 +1288,7 @@ String SvxNumberFormatShell::GetComment4Entry(short 
> nEntry)
>  if(nEntry < 0)
>  return String();
>  
> -if(nEntry +if(nEntry < (short)aCurEntryList.size())
>  {

5. Should short type be replaced with sal_Int16 or more appropriate type?

Best Regards,
Maciej
>From 38fff431d906bfaf39848e443709b7a957d238b2 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Sat, 6 Aug 2011 15:27:06 +0200
Subject: [PATCH] Replace SvULongs with vector and code clean up

Instead of SvULongs use std::vector
Remove unnecessary german comments
Translate some comments
replace sal_Bool with bool where variable is not interfering with return value
---
 svx/inc/svx/numfmtsh.hxx  |7 +-
 svx/source/items/numfmtsh.cxx |  222 -
 2 files changed, 66 insertions(+), 163 deletions(-)

diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx
index a7c6f95..f4e7c06 100644
--- a/svx/inc/svx/numfmtsh.hxx
+++ b/svx/inc/svx/numfmtsh.hxx
@@ -46,6 +46,7 @@
 
 #include 
 
+#include 
 // forward ---
 
 class Color;
@@ -228,9 +229,9 @@ private:
 String	aValStr;
 double	nValNum;
 sal_Bool	bUndoAddList;
-SvULongsaAddList;
-SvULongsaDelList;
-SvULongsaCurEntryList;
+std::vector aAddList;
+std::vector aDelList;
+std::vector aCurEntryList;
 sal_uInt32nInitFormatKey;
 sal_uInt32nCurFormatKey;
 short	nCurCategory;
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 837fdea..8ca37fe 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -159,16 +159,10 @@ SvxNumberFormatShell::~SvxNumberFormatShell()
 // Hinzugefuegte Formate sind nicht gueltig:
 // => wieder entfernen:
 
-for ( sal_uInt16 i = 0; i < aAddList.Count(); ++i )

Re: [Libreoffice] [PATCH] Easy Hack - Get rid ofSvULongs in writer

2011-08-04 Thread Maciej Rumianowski
Dnia 2011-08-04, czw o godzinie 23:23 +0200, Maciej Rumianowski pisze:
> Okay so I will work further on SvULongs, there is some in libs-gui,
> and
> than come back to writer. 

Sorry, I meant libs-core.

If I see any sal_Bool (sal_True, sal_False), should I change it to
standard bool?

Best,
Maciej

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


Re: [Libreoffice] [PATCH] Easy Hack - Get rid ofSvULongs in writer

2011-08-04 Thread Maciej Rumianowski
Dnia 2011-08-04, czw o godzinie 12:09 -0400, Kohei Yoshida pisze:
> On Thu, 2011-08-04 at 00:40 +0200, Maciej Rumianowski wrote:
> 
> Ok.  The new patch looks good (to me).  Pushed to master.

Thanks :)

> 
> > > Other than that, the rest looks okay to me.  I'd prefer someone more
> > > experienced in Writer's code to sanity-check though. 
> > 
> > O, so by the way there is in wrtww8.hxx a VARARR WW8Bytes which should
> > be migrated to ww::bytes. Is it okay to do?
> 
> Yeah, that looks reasonable.  Unless someone who knows more about
> writer's code than I objects, and objects soon, I'd say go for it. :-)

Okay so I will work further on SvULongs, there is some in libs-gui, and
than come back to writer.

Best,
Maciej


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


Re: [Libreoffice] [PATCH] Easy Hack - Get rid ofSvULongs in writer

2011-08-03 Thread Maciej Rumianowski
Dnia 2011-08-03, śro o godzinie 00:23 -0400, Kohei Yoshida pisze:
> 
> @@ -2017,7 +2011,7 @@ bool
> WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
>  {
>  // textbox - content
>  WW8_CP nCP = rWrt.Fc2Cp( rWrt.Strm().Tell() );
> -aCps.Insert( nCP, i );
> +aCps.push_back( nCP );
>  pTxtPos->Append( nCP );
> 
> Hmm are you sure that you can replace that with vector's push_back()
> there?  For this to work correctly the i has to always point to the
> end
> position (last element + 1), but from the surrounding code I'm not
> sure
> if that's guaranteed.  You probably should use vector's insert()
> method
> with a specific insert position, instead of using push_back() in this
> case.

Ups, I will be more careful in the future, I have checked the function
itself but as you said calling this function is not guaranteed with
empty aCps.

> 
> Also, I've seen a code like the following
> 
> if (!vec.empty())
> vec.clear();
> 
> in several places.  While this code is not wrong (since the original
> code was written that way), calling clear() on an empty vector does
> nothing & is harmless.  So just calling clear() should be fine without
> checking for empty-ness.

Ok changed.

> Other than that, the rest looks okay to me.  I'd prefer someone more
> experienced in Writer's code to sanity-check though. 

O, so by the way there is in wrtww8.hxx a VARARR WW8Bytes which should
be migrated to ww::bytes. Is it okay to do?

Best Regards,
  Maciej
>From 80b069e455f1f6f166d279235f3b8c14da07c9b8 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Thu, 4 Aug 2011 00:38:26 +0200
Subject: [PATCH] Get rid of SvULongs in writer

Replace SvULongs with std::vector. In SwHTMLWriter simultaneously replace aOutlineMarks with boost::ptr_vector.
---
 sw/source/filter/html/htmlfly.cxx |   10 ++--
 sw/source/filter/html/wrthtml.cxx |   18 
 sw/source/filter/html/wrthtml.hxx |7 ++-
 sw/source/filter/ww8/wrtw8esh.cxx |4 +-
 sw/source/filter/ww8/wrtw8sty.cxx |   84 +
 sw/source/filter/ww8/wrtww8.cxx   |   24 +--
 sw/source/filter/ww8/wrtww8.hxx   |   24 ---
 7 files changed, 78 insertions(+), 93 deletions(-)

diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index d278127..da7dcd0 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -1832,20 +1832,20 @@ void SwHTMLWriter::AddLinkTarget( const String& rURL )
 SwPosition aPos( *pCurPam->GetPoint() );
 if( pDoc->GotoOutline( aPos, aOutline ) )
 {
-sal_uLong nIdx = aPos.nNode.GetIndex();
+sal_uInt32 nIdx = aPos.nNode.GetIndex();
 
-sal_uInt16 nIns=0;
-while( nIns < aOutlineMarkPoss.Count() &&
+sal_uInt32 nIns=0;
+while( nIns < aOutlineMarkPoss.size() &&
aOutlineMarkPoss[nIns] < nIdx )
 nIns++;
 
-aOutlineMarkPoss.Insert( nIdx, nIns );
+aOutlineMarkPoss.insert( aOutlineMarkPoss.begin()+nIns, nIdx );
 if( bEncoded )
 {
 aURL.Erase( nPos, 2 );
 aURL.SetChar( nPos-1, cMarkSeperator );
 }
-aOutlineMarks.Insert( new String( aURL ), nIns );
+aOutlineMarks.insert( aOutlineMarks.begin()+nIns, new String( aURL ) );
 }
 }
 else if( sCmp.EqualsAscii( pMarkToText ) )
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 1d5975a..ae4fee6 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -402,11 +402,9 @@ sal_uLong SwHTMLWriter::WriteStream()
 if( aImplicitMarks.Count() )
 aImplicitMarks.DeleteAndDestroy( sal_uInt16(0), aImplicitMarks.Count() );
 
-if( aOutlineMarks.Count() )
-aOutlineMarks.DeleteAndDestroy( sal_uInt16(0), aOutlineMarks.Count() );
+aOutlineMarks.clear();
 
-if( aOutlineMarkPoss.Count() )
-aOutlineMarkPoss.Remove( sal_uInt16(0), aOutlineMarkPoss.Count() );
+aOutlineMarkPoss.clear();
 
 if( aNumRuleNames.Count() )
 aNumRuleNames.DeleteAndDestroy( sal_uInt16(0), aNumRuleNames.Count() );
@@ -1066,18 +1064,18 @@ void SwHTMLWriter::OutBookmarks()
 pBookmark = (pMarkAccess->getMarksBegin() + nBkmkTabPos)->get();
 }
 
-sal_uInt16 nPos;
-for( nPos = 0; nPos < aOutlineMarkPoss.Count() &&
+sal_uInt32 nPos;
+for( nPos = 0; nPos < aOutlineMarkPoss.size() &&
aOutlineMarkPoss[nPos] < nNode; nPos++ )
 ; 
 
-while( nPos < aOutlineMarkPoss.Count() && aOutlineMarkPoss[nPos] == nNo

[Libreoffice] [PATCH] Easy Hack - Get rid ofSvULongs in writer

2011-08-02 Thread Maciej Rumianowski
Hello,

This is my second patch for Bug 38831 - [EasyHack] Get rid of
SV_DECL_VARARR, SV_DECL_VARARR_PLAIN, SV_DECL_VARARR_SORT 

It replace SvULongs and WW8_WrSepInfoPtrs (another VARARR) with
std:vector, SvStringsDtor with boost::ptr_vector in writer.

Best Regards,
Maciej
>From fd48141c12a6e9abd84d32fd1553a789bd9e2a4b Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Tue, 2 Aug 2011 17:27:34 +0200
Subject: [PATCH] Get rid of SvULongs in writer

Replace SvULongs with std::vector. In SwHTMLWriter simultaneously replace aOutlineMarks with boost::ptr_vector.
---
 sw/source/filter/html/htmlfly.cxx |   10 ++--
 sw/source/filter/html/wrthtml.cxx |   20 
 sw/source/filter/html/wrthtml.hxx |7 ++-
 sw/source/filter/ww8/wrtw8esh.cxx |4 +-
 sw/source/filter/ww8/wrtw8sty.cxx |   84 +
 sw/source/filter/ww8/wrtww8.cxx   |   24 +--
 sw/source/filter/ww8/wrtww8.hxx   |   24 ---
 7 files changed, 80 insertions(+), 93 deletions(-)

diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index a6bd6c3..873afd5 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -1804,20 +1804,20 @@ void SwHTMLWriter::AddLinkTarget( const String& rURL )
 SwPosition aPos( *pCurPam->GetPoint() );
 if( pDoc->GotoOutline( aPos, aOutline ) )
 {
-sal_uLong nIdx = aPos.nNode.GetIndex();
+sal_uInt32 nIdx = aPos.nNode.GetIndex();
 
-sal_uInt16 nIns=0;
-while( nIns < aOutlineMarkPoss.Count() &&
+sal_uInt32 nIns=0;
+while( nIns < aOutlineMarkPoss.size() &&
aOutlineMarkPoss[nIns] < nIdx )
 nIns++;
 
-aOutlineMarkPoss.Insert( nIdx, nIns );
+aOutlineMarkPoss.insert( aOutlineMarkPoss.begin()+nIns, nIdx );
 if( bEncoded )
 {
 aURL.Erase( nPos, 2 );
 aURL.SetChar( nPos-1, cMarkSeperator );
 }
-aOutlineMarks.Insert( new String( aURL ), nIns );
+aOutlineMarks.insert( aOutlineMarks.begin()+nIns, new String( aURL ) );
 }
 }
 else if( sCmp.EqualsAscii( pMarkToText ) )
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 0e78fae..e6baa5a 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -402,11 +402,11 @@ sal_uLong SwHTMLWriter::WriteStream()
 if( aImplicitMarks.Count() )
 aImplicitMarks.DeleteAndDestroy( sal_uInt16(0), aImplicitMarks.Count() );
 
-if( aOutlineMarks.Count() )
-aOutlineMarks.DeleteAndDestroy( sal_uInt16(0), aOutlineMarks.Count() );
+if( !aOutlineMarks.empty() )
+aOutlineMarks.clear();
 
-if( aOutlineMarkPoss.Count() )
-aOutlineMarkPoss.Remove( sal_uInt16(0), aOutlineMarkPoss.Count() );
+if( !aOutlineMarkPoss.empty() )
+aOutlineMarkPoss.clear();
 
 if( aNumRuleNames.Count() )
 aNumRuleNames.DeleteAndDestroy( sal_uInt16(0), aNumRuleNames.Count() );
@@ -1065,18 +1065,18 @@ void SwHTMLWriter::OutBookmarks()
 pBookmark = (pMarkAccess->getMarksBegin() + nBkmkTabPos)->get();
 }
 
-sal_uInt16 nPos;
-for( nPos = 0; nPos < aOutlineMarkPoss.Count() &&
+sal_uInt32 nPos;
+for( nPos = 0; nPos < aOutlineMarkPoss.size() &&
aOutlineMarkPoss[nPos] < nNode; nPos++ )
 ; 
 
-while( nPos < aOutlineMarkPoss.Count() && aOutlineMarkPoss[nPos] == nNode )
+while( nPos < aOutlineMarkPoss.size() && aOutlineMarkPoss[nPos] == nNode )
 {
-String sMark( *aOutlineMarks[nPos] );
+String sMark( aOutlineMarks[nPos] );
 sMark.SearchAndReplaceAll( '?', '_' );  // '?' causes problems in IE/Netscape 5
 OutAnchor( sMark );
-aOutlineMarkPoss.Remove( nPos, 1 );
-aOutlineMarks.DeleteAndDestroy( nPos, 1 );
+aOutlineMarkPoss.erase( aOutlineMarkPoss.begin()+nPos );
+aOutlineMarks.erase( aOutlineMarks.begin() + nPos );
 }
 }
 
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 4e040f1..83f93f4 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -28,13 +28,14 @@
 #ifndef _WRTHTML_HXX
 #define _WRTHTML_HXX
 
+#include 
+#include 
 
 #include 
 #include 
 #include 
 #define _SVSTDARR_STRINGSDTOR
 #define _SVSTDARR_STRINGSSORTDTOR
-#define _SVSTDARR_ULONGS
 #include 
 #include 
 #include 
@@ -227,11 +228,11 @@ public:
 
 SvStringsDtor aImgMapNames;		// geschriebene Image Maps
 SvStringsSortDtor aImplicitMarks;// implizite Stprungmarken
-SvStringsDtor aOutlineMarks;		// geschriebene Image Maps
 SvStringsSortDtor aNumRuleNames;// Names of exported num rules
 SvStringsSortDtor aScriptParaStyl

Re: [Libreoffice] [Libreoofice] build errors - missing SvStream::remainingSize

2011-07-21 Thread Maciej Rumianowski
Dnia 2011-07-22, pią o godzinie 03:07 +0700, thamht pisze:
> Hi,
> 
> I'm trying to build libreoffice right after './g pull -r' to get the 
> latest source code, however, there are some errors as the following:

I see that SvStream was added 3 days ago, are you sure ./g pull -r went fine?

> /media/LinuxData/git/libo/clone/filters/filter/source/msfilter/msdffimp.cxx: 
> In member function 'virtual sal_Bool 
> SvxMSDffManager::ProcessClientAnchor(SvStream&, sal_uInt32, char*&, 
> sal_uInt32&) const':
> 
> /media/LinuxData/git/libo/clone/filters/filter/source/msfilter/msdffimp.cxx:6973:37:
>  error: 'class SvStream' has no member named 'remainingSize'
> 
> /media/LinuxData/git/libo/clone/filters/filter/source/msfilter/msdffimp.cxx: 
> In member function 'virtual sal_Bool 
> SvxMSDffManager::ProcessClientData(SvStream&, sal_uInt32, char*&, 
> sal_uInt32&) const':
> 
> /media/LinuxData/git/libo/clone/filters/filter/source/msfilter/msdffimp.cxx:6985:37:
>  error: 'class SvStream' has no member named 'remainingSize'
> 
> dmake:  Error code 1, while making '../../unxlngi6.pro/slo/msdffimp.obj'
> 
> 
> I have tried to make clean & build internally:
> 
> rm -Rf /media/LinuxData/git/libo/filter/unxlngi6.pro # optional module 'clean'
> 
> /bin/sh
> 
> cd /media/LinuxData/git/libo
> 
> source ./LinuxX86Env.Set.sh
> 
> cd filter

Try also rebuild tools module (cd tools), because SvStream is there.

Cheers,

Maciej


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


Re: [Libreoffice] [Fwd: RE: LibreOffice Build Problem]

2011-07-21 Thread Maciej Rumianowski
Hi,

I forwarded Tugay's message to list, because he forgot.

@Michael there is part to you.

> > /home/ilbay/Desktop/libreoffice/bootstrap/svtools/source/contnr/imivctl1.cxx:295:
> >  error: prototype for ‘void 
> > SvxIconChoiceCtrl_Impl::InsertEntry(SvxIconChoiceCtrlEntry*, size_t, const 
> > Point*)’ does not match any in class ‘SvxIconChoiceCtrl_Impl’
> > /home/ilbay/Desktop/libreoffice/bootstrap/svtools/source/contnr/imivctl.hxx:354:
> >  error: candidate is: void 
> > SvxIconChoiceCtrl_Impl::InsertEntry(SvxIconChoiceCtrlEntry*, sal_uLong, 
> > const Point*)
> > make: ***
> > [/home/ilbay/Desktop/libreoffice/bootstrap/solver/350/unxlngi6.pro/workdir/CxxObject/svtools/source/contnr/imivctl1.o]
> >  Error 1
> > ilbay@ilbay-U-100:~/Desktop/libreoffice/bootstrap/svtools$ make -r >
> > build.log
> > /home/ilbay/Desktop/libreoffice/bootstrap/svtools/source/contnr/imivctl1.cxx:295:
> >  error: prototype for ‘void 
> > SvxIconChoiceCtrl_Impl::InsertEntry(SvxIconChoiceCtrlEntry*, size_t, const 
> > Point*)’ does not match any in class ‘SvxIconChoiceCtrl_Impl’
> > /home/ilbay/Desktop/libreoffice/bootstrap/svtools/source/contnr/imivctl.hxx:354:
> >  error: candidate is: void 
> > SvxIconChoiceCtrl_Impl::InsertEntry(SvxIconChoiceCtrlEntry*, sal_uLong, 
> > const Point*)
> > make: ***
> > [/home/ilbay/Desktop/libreoffice/bootstrap/solver/350/unxlngi6.pro/workdir/CxxObject/svtools/source/contnr/imivctl1.o]
> >  Error 1

I know that one!
You have to ./g pull -r
You have an old master with bad patch, it has been fixed recently.

Best,
Maciej


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


[Libreoffice] [Fwd: RE: LibreOffice Build Problem]

2011-07-21 Thread Maciej Rumianowski

--- Begin Message ---

Hi,

I did the following:

> > rm -Rf /home/ilbay/Desktop/libreoffice/bootstrap/svtools/unxlngi6.pro
> > # optional module 'clean'
> > /bin/bash
> > cd /home/ilbay/Desktop/libreoffice/bootstrap
> > source ./LinuxX86Env.Set.sh
> > cd svtools
> > make -r

and I got this error message:

/home/ilbay/Desktop/libreoffice/bootstrap/svtools/source/contnr/imivctl1.cxx:295:
 error: prototype for ‘void 
SvxIconChoiceCtrl_Impl::InsertEntry(SvxIconChoiceCtrlEntry*, size_t, const 
Point*)’ does not match any in class ‘SvxIconChoiceCtrl_Impl’
/home/ilbay/Desktop/libreoffice/bootstrap/svtools/source/contnr/imivctl.hxx:354:
 error: candidate is: void 
SvxIconChoiceCtrl_Impl::InsertEntry(SvxIconChoiceCtrlEntry*, sal_uLong, const 
Point*)
make: *** 
[/home/ilbay/Desktop/libreoffice/bootstrap/solver/350/unxlngi6.pro/workdir/CxxObject/svtools/source/contnr/imivctl1.o]
 Error 1
ilbay@ilbay-U-100:~/Desktop/libreoffice/bootstrap/svtools$ make -r > build.log
/home/ilbay/Desktop/libreoffice/bootstrap/svtools/source/contnr/imivctl1.cxx:295:
 error: prototype for ‘void 
SvxIconChoiceCtrl_Impl::InsertEntry(SvxIconChoiceCtrlEntry*, size_t, const 
Point*)’ does not match any in class ‘SvxIconChoiceCtrl_Impl’
/home/ilbay/Desktop/libreoffice/bootstrap/svtools/source/contnr/imivctl.hxx:354:
 error: candidate is: void 
SvxIconChoiceCtrl_Impl::InsertEntry(SvxIconChoiceCtrlEntry*, sal_uLong, const 
Point*)
make: *** 
[/home/ilbay/Desktop/libreoffice/bootstrap/solver/350/unxlngi6.pro/workdir/CxxObject/svtools/source/contnr/imivctl1.o]
 Error 1


Also I tried this http://wiki.documentfoundation.org/Development/Native_Build  
, but unfortunately nothing changed :(.

Thank you for all your help.

Sincerely,
Tugay Ilbay

PS: @Michael, I want to contribute developing code. Maybe it is better for me 
to begin with easy-hacking in order to get familiar with LibreOffice. However, 
I will be pleased if I hear what you think.
  --- End Message ---
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH] Get rid of SvULongs in calc

2011-07-20 Thread Maciej Rumianowski
Dnia 2011-07-20, śro o godzinie 17:12 -0400, Kohei Yoshida pisze:
> 
> So, I've reviewed your revised patches and they look good.  I've
> pushed
> them to master with one minor syntactic change.

Great thanks :)

> Anyway, thanks for your patches again, and we look forward to
> receiving
> more patches from you in the future. :-) 

I'm working further on Bug 38831 - [EasyHack] Get rid of SV_DECL_VARARR,
SV_DECL_VARARR_PLAIN, SV_DECL_VARARR_SORT ...

Where can I mark that I'm working on it? In Bug comments?

Best Regards,
Maciej

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


Re: [Libreoffice] LibreOffice Build Problem

2011-07-20 Thread Maciej Rumianowski
Hi,

> I would like to join the LibreOffice development community, but i have
> a problem.
Recently I have also joined LibreOffice development me first patch is
waiting to be pushed, so Hello:)

> I tried to build LibreOffice as shown on
> http://www.libreoffice.org/get-involved/developers/. But when i tried
You can get more info on this site:
http://wiki.documentfoundation.org/Development/Native_Build

>   internal build errors:
> 
> ERROR: error 65280 occurred while
> making /home/ilbay/Desktop/libreoffice/bootstrap/svtools/prj
> 
>  it seems that the error is inside 'svtools', please re-run build
>  inside this module to isolate the error and/or test your fix:
> ---
> 
> rm -Rf /home/ilbay/Desktop/libreoffice/bootstrap/svtools/unxlngi6.pro
> # optional module 'clean'
> /bin/bash
> cd /home/ilbay/Desktop/libreoffice/bootstrap
> source ./LinuxX86Env.Set.sh
> cd svtools
> make -r

Have you done as described above? What errors do you have when compiling
this module? Above error as general, more info is needed.

> I don't know what to do. I googled it but I got no answer. I will be
> pleased and thankful to you for your helps.

Just ask when you have problems and look at development wiki
http://wiki.documentfoundation.org/Development

Best Regards,
Maciej


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


Re: [Libreoffice] sylk unit tests

2011-07-19 Thread Maciej Rumianowski
Hi Michael,

>   Hey ! - so unit tests are -never- useless, particularly if they are
> fast, small and run during the build. Indeed - I would -love- to have
> much more unit test coverage of calc.

I also like the Idea of unit tests and an Easy Hack with calc unit tests
is on my radar :)

>   It would be simply excellent if we could find a way of doing this. One
> thing I would strongly recommend is not trying to create your own,
> stand-alone unit test harness, but instead building on top of an
> existing test by adding a new test method in sc/qa/unit/ucalc.cxx :-)
> [ indeed, reading that it is encouraging to see the growth in
> unit-testage there particularly for data-pilots etc. ;-].

My first attempt was to write test there.

>   Anyhow - thanks for your work !
I'm glad to work on LibreOffice! I'm following Document Foundation and
LO from the beginning ;)

Best Regards,
Maciej


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


Re: [Libreoffice] [PATCH] Get rid of SvULongs in calc

2011-07-19 Thread Maciej Rumianowski
Hi Kohei,
Thanks for review!

> First, for your svl patch:
> 
> 1) in SfxIntegerListItem::GetList(), you do
> 
> +rList.insert( aIt, m_aList[n] );
> 
> but you can simply call push_back here to append new data to the end of
> the vector.  Also, let's use pre-increment on iterators in the "for"
> loop there i.e. instead of doing aIt++, do ++aIt.  Post-increment on
> iterators is generally more expensive than pre-increment, so it's best
> to stick with pre-increments.

Done, and with push_back we don't need iterator.

> 2) Your new constructors take arrays of different integer type; one
> takes std::vector while the other takes
> uno::Sequence.  Let's just stick with one type and use
> sal_Int32 in both cases since that's the integer type that this class
> uses internally.

Done and checked in other places to use right type.

> And for your sc patch:
> 
> 3) In ScTabViewShell::Execute() you do
> 
> -SvULongs aIndexList( 4, 4 );
> +::std::vector < sal_uLong > aIndexList( 4, 4 );
> 
> but this actually changes the behavior of the code.  The arguments to
> SvULong's constructor controls how the internal array is laid out during
> initialization but it doesn't populate the container with data.
> Vector's ctor arguments OTOH populate the container with data.  So, your
> new code initializes aIndexList with 4 elements of value 4, which is not
> what the code intends to do.  You can simply do without passing any
> arguments to aIndexList there.

Done, Now I understand the SvULong's constructor. Also changed type to
sal_uInt32.

> 4) Last but not least, please state that you are submitting your patches
> under LGPLv3+/MPL 1.1.

Of course and future also.

Best Regards,
Maciej

>From a4f2da5241afdd8062f9611ca1f580df1c2ffe54 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Tue, 19 Jul 2011 10:50:54 +0200
Subject: [PATCH] Get rid of SvULongs in calc

Instead of SvULongs use ::std::vector < sal_Int32 >
---
 .../itemsetwrapper/DataPointItemConverter.cxx  |7 +--
 .../itemsetwrapper/SeriesOptionsItemConverter.cxx  |7 +--
 chart2/source/view/main/ChartItemPool.cxx  |8 +++-
 sc/source/ui/docshell/impex.cxx|   11 +--
 sc/source/ui/view/tabvwsh3.cxx |   11 +--
 5 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 3802ffc..76e7db0 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -54,8 +54,6 @@
 #include 
 //SfxIntegerListItem
 #include 
-#define _SVSTDARR_ULONGS
-#include 
 #include 
 #include 
 
@@ -641,10 +639,7 @@ void DataPointItemConverter::FillSpecialItem(
 
 case SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS:
 {
-SvULongs aList;
-for ( sal_Int32 nN=0; nN(nN) );
-rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
+rOutItemSet.Put( SfxIntegerListItem( nWhichId, m_aAvailableLabelPlacements ) );
 }
 break;
 
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index a199b66..7df2d61 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -51,8 +51,6 @@
 
 //SfxIntegerListItem
 #include 
-#define _SVSTDARR_ULONGS
-#include 
 
 #include 
 #include 
@@ -433,10 +431,7 @@ void SeriesOptionsItemConverter::FillSpecialItem(
 }
 case SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS:
 {
-SvULongs aList;
-for ( sal_Int32 nN=0; nN(nN) );
-rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
+rOutItemSet.Put( SfxIntegerListItem( nWhichId, m_aSupportedMissingValueTreatments ) );
 break;
 }
 case SCHATTR_INCLUDE_HIDDEN_CELLS:
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 2cdac8f..aa81e06 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -39,10 +39,9 @@
 #include 
 #include 
 #include 
-#define _SVSTDARR_ULONGS
-#include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -63,8 +62,7 @@ ChartItemPool::ChartItemPool():
 ppPoolDefaults[SCHATTR_DATADESCR_SHOW_SYMBOL- SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_SYMBOL);
 ppPoolDefaults[SCHATTR_DATADESCR_SEPARATOR  - SCHATTR_START] = new SfxStringItem(SCHATTR_DATADESCR_SEPARATOR,C2U(&

Re: [Libreoffice] [PATCH] Get rid of SvULongs in calc

2011-07-18 Thread Maciej Rumianowski
Spotted some mistakes in calc patch.
>From e7db01344f8fef4ca2f2f59868736033d0126b1b Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Mon, 18 Jul 2011 09:22:57 +0200
Subject: [PATCH] Get rid of SvULongs in calc

Instead of SvULongs use ::std::vector < sal_uLong >
---
 .../itemsetwrapper/DataPointItemConverter.cxx  |7 +--
 .../itemsetwrapper/SeriesOptionsItemConverter.cxx  |7 +--
 chart2/source/view/main/ChartItemPool.cxx  |8 +++-
 sc/source/ui/docshell/impex.cxx|   11 +--
 sc/source/ui/view/tabvwsh3.cxx |8 
 5 files changed, 14 insertions(+), 27 deletions(-)

diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 3802ffc..76e7db0 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -54,8 +54,6 @@
 #include 
 //SfxIntegerListItem
 #include 
-#define _SVSTDARR_ULONGS
-#include 
 #include 
 #include 
 
@@ -641,10 +639,7 @@ void DataPointItemConverter::FillSpecialItem(
 
 case SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS:
 {
-SvULongs aList;
-for ( sal_Int32 nN=0; nN(nN) );
-rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
+rOutItemSet.Put( SfxIntegerListItem( nWhichId, m_aAvailableLabelPlacements ) );
 }
 break;
 
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index a199b66..7df2d61 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -51,8 +51,6 @@
 
 //SfxIntegerListItem
 #include 
-#define _SVSTDARR_ULONGS
-#include 
 
 #include 
 #include 
@@ -433,10 +431,7 @@ void SeriesOptionsItemConverter::FillSpecialItem(
 }
 case SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS:
 {
-SvULongs aList;
-for ( sal_Int32 nN=0; nN(nN) );
-rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
+rOutItemSet.Put( SfxIntegerListItem( nWhichId, m_aSupportedMissingValueTreatments ) );
 break;
 }
 case SCHATTR_INCLUDE_HIDDEN_CELLS:
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 2cdac8f..82df33d 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -39,10 +39,9 @@
 #include 
 #include 
 #include 
-#define _SVSTDARR_ULONGS
-#include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -63,8 +62,7 @@ ChartItemPool::ChartItemPool():
 ppPoolDefaults[SCHATTR_DATADESCR_SHOW_SYMBOL- SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_SYMBOL);
 ppPoolDefaults[SCHATTR_DATADESCR_SEPARATOR  - SCHATTR_START] = new SfxStringItem(SCHATTR_DATADESCR_SEPARATOR,C2U(" "));
 ppPoolDefaults[SCHATTR_DATADESCR_PLACEMENT  - SCHATTR_START] = new SfxInt32Item(SCHATTR_DATADESCR_PLACEMENT,0);
-SvULongs aTmp;
-ppPoolDefaults[SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS,aTmp);
+ppPoolDefaults[SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, ::std::vector < sal_uLong >() );
 ppPoolDefaults[SCHATTR_DATADESCR_NO_PERCENTVALUE- SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE);
 ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE  - SCHATTR_START] = new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
 ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_SOURCE - SCHATTR_START] = new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
@@ -157,7 +155,7 @@ ChartItemPool::ChartItemPool():
 ppPoolDefaults[SCHATTR_CLOCKWISE- SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, sal_False );
 
 ppPoolDefaults[SCHATTR_MISSING_VALUE_TREATMENT- SCHATTR_START] = new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT, 0);
-ppPoolDefaults[SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,aTmp);
+ppPoolDefaults[SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, ::std::vector < sal_uLong >() );
 ppPoolDefaults[SCHATTR_INCLUDE_HIDDEN_CELLS - SCHATTR_START] = new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, sal_True);
 
 ppPoolDefaults[SCHATTR_AXIS_FOR_ALL_SERIES  - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES, 0);
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 7b0e30d..06fa392 100644
--- a/sc/source

[Libreoffice] [PATCH] Get rid of SvULongs in calc

2011-07-17 Thread Maciej Rumianowski
Hi,

I'm sending a Patch which converts SvULongs to std::vector < sal_uLong
>.

> I would like to add a constructor
> SfxIntegerListItem::SfxIntegerListItem( const ::com::sun::star::uno::Sequence 
> < sal_Int32 > rList ), because DataPointItemConverter and 
> SeriesOptionsItemConverter are copying from Sequence to SvULongs and then in 
> SfxIntegerListItem SvLongs is copied to Sequence.
As I wrote before I have added a constructor to SfxIntegerListItem, is
it okay?

Best Regards,
Maciej
>From 6af35271b8738116393900ba349354d1f3f0bf1b Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Sun, 17 Jul 2011 23:24:45 +0200
Subject: [PATCH] Get rid of SvULongs in calc

Instead of SvULongs use ::std::vector < sal_uLong >
---
 .../itemsetwrapper/DataPointItemConverter.cxx  |6 +++---
 .../itemsetwrapper/SeriesOptionsItemConverter.cxx  |6 +++---
 chart2/source/view/main/ChartItemPool.cxx  |5 ++---
 sc/source/ui/docshell/impex.cxx|   11 +--
 sc/source/ui/view/tabvwsh3.cxx |8 
 5 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 3802ffc..fb1c5f8 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -641,10 +641,10 @@ void DataPointItemConverter::FillSpecialItem(
 
 case SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS:
 {
-SvULongs aList;
+/*SvULongs aList;
 for ( sal_Int32 nN=0; nN(nN) );
-rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
+aList.Insert( m_aAvailableLabelPlacements[nN], sal::static_int_cast< sal_uInt16 >(nN) );*/
+rOutItemSet.Put( SfxIntegerListItem( nWhichId, m_aAvailableLabelPlacements ) );
 }
 break;
 
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index a199b66..dd844c6 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -433,10 +433,10 @@ void SeriesOptionsItemConverter::FillSpecialItem(
 }
 case SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS:
 {
-SvULongs aList;
+/*SvULongs aList;
 for ( sal_Int32 nN=0; nN(nN) );
-rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
+aList.Insert( m_aSupportedMissingValueTreatments[nN], sal::static_int_cast< sal_uInt16 >(nN) );*/
+rOutItemSet.Put( SfxIntegerListItem( nWhichId, m_aSupportedMissingValueTreatments ) );
 break;
 }
 case SCHATTR_INCLUDE_HIDDEN_CELLS:
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 2cdac8f..da10db9 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -63,8 +63,7 @@ ChartItemPool::ChartItemPool():
 ppPoolDefaults[SCHATTR_DATADESCR_SHOW_SYMBOL- SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_SYMBOL);
 ppPoolDefaults[SCHATTR_DATADESCR_SEPARATOR  - SCHATTR_START] = new SfxStringItem(SCHATTR_DATADESCR_SEPARATOR,C2U(" "));
 ppPoolDefaults[SCHATTR_DATADESCR_PLACEMENT  - SCHATTR_START] = new SfxInt32Item(SCHATTR_DATADESCR_PLACEMENT,0);
-SvULongs aTmp;
-ppPoolDefaults[SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS,aTmp);
+ppPoolDefaults[SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, ::std::vector < sal_uLong >() );
 ppPoolDefaults[SCHATTR_DATADESCR_NO_PERCENTVALUE- SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE);
 ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE  - SCHATTR_START] = new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
 ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_SOURCE - SCHATTR_START] = new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
@@ -157,7 +156,7 @@ ChartItemPool::ChartItemPool():
 ppPoolDefaults[SCHATTR_CLOCKWISE- SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, sal_False );
 
 ppPoolDefaults[SCHATTR_MISSING_VALUE_TREATMENT- SCHATTR_START] = new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT, 0);
-ppPoolDefaults[SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,aTmp);
+ppPoolDefaults[SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_V

[Libreoffice] SfxIntegerListItem constructor used by DataPointItemConverter and SeriesOptionsItemConverter

2011-07-17 Thread Maciej Rumianowski
Hi,

I'm working on getting rid of SvULongs in calc. Mainly SvULongs are used
by SfxIntegerListItem which is then used in calc. 

I would like to add a constructor
SfxIntegerListItem::SfxIntegerListItem( const ::com::sun::star::uno::Sequence < 
sal_Int32 > rList ), because DataPointItemConverter and 
SeriesOptionsItemConverter are copying from Sequence to SvULongs and then in 
SfxIntegerListItem SvLongs is copied to Sequence.

Files:
/calc/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx:644
/calc/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx:436
/libs-gui/svl/source/items/ilstitem.cxx:47

Best Regards,
    Maciej Rumianowski

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


Re: [Libreoffice] sylk unit tests

2011-07-17 Thread Maciej Rumianowski
Hi Caolán,

> Hmm, well I've now added a sylk import unit test to sc, i.e.
> http://cgit.freedesktop.org/libreoffice/calc/commit/?id=8ac49ef8ab4f065d7b729dcb15505c602c77
>  

Thanks, but as Nigel pointed out it's hard to unit test every peace of
LO and I don't think my small change is worth it.

Later on I will mail my Patch "getting rid of SvULongs in calc".

Best Regards,
Maciej

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


Re: [Libreoffice] [PATCH] [PUSHED] Re: svtools/source/contnr/imivctl1.cxx not matching imivctl1.hxx

2011-07-17 Thread Maciej Rumianowski
Dnia 2011-07-17, nie o godzinie 06:49 -0700, Joseph Powers pisze:
> I changed the .hxx instead of the .cxx; we really should be using
> size_t instead of sal_uLong.
Thanks! I will remember this.

Maciej

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


[Libreoffice] [PATCH] Re: svtools/source/contnr/imivctl1.cxx not matching imivctl1.hxx

2011-07-16 Thread Maciej Rumianowski
Dnia 2011-07-16, sob o godzinie 15:37 +0200, Maciej Rumianowski pisze:
> Hi,
> 
> in latest commit:
> http://cgit.freedesktop.org/libreoffice/libs-gui/diff/svtools/source/contnr/imivctl1.cxx?id=593060f913a253b5a1998c7791e7ed87e7f49c97
> 
> imivctl.hxx and imivctl1.cxx were changed, but
> SvxIconChoiceCtrl_Impl::InsertEntry declaration doesn't match
> definition.
> 
> I have changed it and now building again if it works, I will send a
> Patch. It will be my first :)
Is working:)
Patch in attachment, ofcourse on LGPL3+/GPL3+/MPL.
> 
> Best Regards,
>   Maciek
> 

>From ee44f22e6f99fde917c2ceb931ec6fc88b2ffa97 Mon Sep 17 00:00:00 2001
From: Maciej Rumianowski 
Date: Sat, 16 Jul 2011 17:12:55 +0200
Subject: [PATCH] fix SvxIconChoiceCtrl_Impl::InsertEntry build error

definition in source/contnr/imivctl1.cxx didn't match declaration in source/contnr/imivctl.hxx
---
 svtools/source/contnr/imivctl1.cxx |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index a406b3e..6d46e32 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -292,7 +292,7 @@ void SvxIconChoiceCtrl_Impl::FontModified()
 ShowCursor( sal_True );
 }
 
-void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t nPos,
+void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos,
 const Point* pPos )
 {
 StopEditTimer();
-- 
1.7.4.1

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


[Libreoffice] svtools/source/contnr/imivctl1.cxx not matching imivctl1.hxx

2011-07-16 Thread Maciej Rumianowski
Hi,

in latest commit:
http://cgit.freedesktop.org/libreoffice/libs-gui/diff/svtools/source/contnr/imivctl1.cxx?id=593060f913a253b5a1998c7791e7ed87e7f49c97

imivctl.hxx and imivctl1.cxx were changed, but
SvxIconChoiceCtrl_Impl::InsertEntry declaration doesn't match
definition.

I have changed it and now building again if it works, I will send a
Patch. It will be my first :)

Best Regards,
Maciek

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


[Libreoffice] Bug 38831 - [EasyHack] Get rid of SV_DECL_VARARR, SV_DECL_VARARR_PLAIN, SV_DECL_VARARR_SORT ....

2011-07-11 Thread Maciej Rumianowski
Hi,

First all you awesome Developers are doing great Software! I would like
to help you:)

I picked up this bug and tried to get rid of SvULongs.
I found for example in ScImportExport::Sylk2Doc and thought it would be
good to first write a unit test (since there are unit tests of calc).
But I wasn't successful using ScImportExport::ImportStream and
ScImportExport::ExportStream, which use Sylk2Doc.

Is it a right way I'm going to start develop LibreOffice or you what me
somewhere else in code?

Best Regards,
Maciek Rumianowski

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