Re: regarding patch 38838

2013-02-20 Thread Michael Stahl
On 17/02/13 22:52, Prashant Pandey wrote:
> Error: a unit test failed, please do one of:
> 
> export DEBUGCPPUNIT=TRUE# for exception catching
> export GDBCPPUNITTRACE="gdb --args" # for interactive debugging
> export VALGRIND=memcheck# for memory checking
> and retry.
> make[1]: ***
> [/home/elixir/lo/workdir/unxlngx6.pro/CppunitTest/sd_regression_test.test 
> ]
> Error 1
> make[1]: *** Waiting for unfinished jobs
> 
> Can't get rid of it and i don't have any clue too, please guide !

a unit test has failed.

this is either a pre-existing problem in the LO code, a problem in the
the test, or a problem in your modifications.

you can try if it happens after you remove your changes with

  git stash save

if "make" then runs all tests successfully but fails again after you do

  git stash pop

then the most likely explanation is that your modifications introduced
an error somewhere.

you can debug the test by following the instructions in the message and
running:

 GDBCPPUNITTRACE="gdb --args"  make
/home/elixir/lo/workdir/unxlngx6.pro/CppunitTest/sd_regression_test.test


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


Re: regarding patch 38838

2013-02-17 Thread Prashant Pandey
Hi Nobert,

I corrected myself in the following mail with this one.
I did : aRealStyle.copy(aRealStyle.indexOf(aSep) + aSep.getLength());
which I suppose is doing the same thing as required.

since foo.erase(0,n) => foo=foo.copy(n)

Still, if I am wrong, then please inform.

Thanks
Prashant

On Mon, Feb 18, 2013 at 4:17 AM, Norbert Thiebaud wrote:

> On Sun, Feb 17, 2013 at 3:36 PM, Prashant Pandey
>  wrote:
> > Hi Jean,
> >
> > Thanks for help !
> >
> > Finally, I did : aRealStyle.copy(0,(aRealStyle.Search(aSep) +
> aSep.Len()));
> >
> > It also worked :)
>
> No it did not work. it compiled, but it does not do the same as the
> orginal code.
>
> Norbert
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: regarding patch 38838

2013-02-17 Thread Norbert Thiebaud
On Sun, Feb 17, 2013 at 3:36 PM, Prashant Pandey
 wrote:
> Hi Jean,
>
> Thanks for help !
>
> Finally, I did : aRealStyle.copy(0,(aRealStyle.Search(aSep) + aSep.Len()));
>
> It also worked :)

No it did not work. it compiled, but it does not do the same as the
orginal code.

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


Re: regarding patch 38838

2013-02-17 Thread Prashant Pandey
I've changed several files.
When I try to 'make' : a lot of stuff is printed regarding XShape,
CustomShapeGeometry, PointSequence, etc

Then error is printed as :

diff.cxx:332:Assertion
Test name: SdFiltersTest::test
double equality assertion failed
- Expected: 3433903
- Actual  : 0
- Delta   : 1e-08
- startColor

Failures !!!
Run: 3   Failure total: 1   Failures: 1   Errors: 0

Error: a unit test failed, please do one of:

export DEBUGCPPUNIT=TRUE# for exception catching
export GDBCPPUNITTRACE="gdb --args" # for interactive debugging
export VALGRIND=memcheck# for memory checking
and retry.
make[1]: *** [/home/elixir/lo/workdir/
unxlngx6.pro/CppunitTest/sd_regression_test.test] Error 1
make[1]: *** Waiting for unfinished jobs

Can't get rid of it and i don't have any clue too, please guide !

Thanking you in anticipation.

Regards
Prashant

On Mon, Feb 18, 2013 at 3:09 AM, Prashant Pandey
wrote:

> Sorry, it was *aRealStyle.copy(aRealStyle.Search(aSep) + aSep.Len());*which 
> made it through correctly.
>
> Thanks
> Prashant
>
>
> On Mon, Feb 18, 2013 at 3:06 AM, Prashant Pandey <
> prashant3.yi...@gmail.com> wrote:
>
>> Hi Jean,
>>
>> Thanks for help !
>>
>> Finally, I did : *aRealStyle.copy(0,(aRealStyle.Search(aSep) +
>> aSep.Len()));*
>>
>> It also worked :)
>>
>> Thanks once again!
>>
>> -Prashant
>>
>>
>> On Sun, Feb 17, 2013 at 11:11 PM, Jean-Noël Rouvignac <
>> jn.rouvig...@gmail.com> wrote:
>>
>>> Hi Prashant,
>>>
>>> 2013/2/17 Prashant Pandey 
>>>
 Hi,

>
> I need some guidance as am stuck at a place.
> How should I replace 'erase' using guidelines given under
> https://wiki.documentfoundation.org/Development/String_Classes.
> If I try to fit 'replaceAt' in place of 'erase' in the line bolded
> below:
>
> *aRealStyle.Erase(aRealStyle.Search(aSep) + aSep.Len());*
>
> it will give me error (if I do : 
> *aRealStyle.replaceAt(aRealStyle.indexOf(aSep)
> + aSep.getLength());*)
>
> Reason:
>
> replaceAt defined as: rtl::OUString
> rtl::OUString::replaceAt(sal_Int32, sal_Int32, const rtl::OUString&) const
> (candidate expects 3 arguments, 1 provided)
> error: no matching function for call to
> ‘rtl::OUString::replaceAt(sal_Int32)
>
> My question is, what should I pass inside the replaceAt()
> parameters/arguments?
>

>>> I would suggest you write this:
>>> *sal_int32 idx = **aRealStyle.indexOf(aSep) + aSep.getLength();*
>>> ***aRealStyle = aRealStyle.replaceAt(idx, **aRealStyle.getLength()
>>> - **aRealStyle, "");*
>>>
>>> Because:
>>>
>>>- If nIndex is set then can use replaceAt with an arg of an empty
>>>string (from the wiki page)
>>>- The second argument is the count, and here we replace until the
>>>end of the string
>>>- Since OUString is immutable, you must assign back the resulting
>>>OUString if you do not want to lose it
>>>
>>> Cheers,
>>>
>>> Jean-Noël
>>>
>>
>>
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: regarding patch 38838

2013-02-17 Thread Prashant Pandey
Sorry, it was *aRealStyle.copy(aRealStyle.Search(aSep) +
aSep.Len());*which made it through correctly.

Thanks
Prashant

On Mon, Feb 18, 2013 at 3:06 AM, Prashant Pandey
wrote:

> Hi Jean,
>
> Thanks for help !
>
> Finally, I did : *aRealStyle.copy(0,(aRealStyle.Search(aSep) +
> aSep.Len()));*
>
> It also worked :)
>
> Thanks once again!
>
> -Prashant
>
>
> On Sun, Feb 17, 2013 at 11:11 PM, Jean-Noël Rouvignac <
> jn.rouvig...@gmail.com> wrote:
>
>> Hi Prashant,
>>
>> 2013/2/17 Prashant Pandey 
>>
>>> Hi,
>>>

 I need some guidance as am stuck at a place.
 How should I replace 'erase' using guidelines given under
 https://wiki.documentfoundation.org/Development/String_Classes.
 If I try to fit 'replaceAt' in place of 'erase' in the line bolded
 below:

 *aRealStyle.Erase(aRealStyle.Search(aSep) + aSep.Len());*

 it will give me error (if I do : 
 *aRealStyle.replaceAt(aRealStyle.indexOf(aSep)
 + aSep.getLength());*)

 Reason:

 replaceAt defined as: rtl::OUString rtl::OUString::replaceAt(sal_Int32,
 sal_Int32, const rtl::OUString&) const
 (candidate expects 3 arguments, 1 provided)
 error: no matching function for call to
 ‘rtl::OUString::replaceAt(sal_Int32)

 My question is, what should I pass inside the replaceAt()
 parameters/arguments?

>>>
>> I would suggest you write this:
>> *sal_int32 idx = **aRealStyle.indexOf(aSep) + aSep.getLength();*
>> ***aRealStyle = aRealStyle.replaceAt(idx, **aRealStyle.getLength() -
>> **aRealStyle, "");*
>>
>> Because:
>>
>>- If nIndex is set then can use replaceAt with an arg of an empty
>>string (from the wiki page)
>>- The second argument is the count, and here we replace until the end
>>of the string
>>- Since OUString is immutable, you must assign back the resulting
>>OUString if you do not want to lose it
>>
>> Cheers,
>>
>> Jean-Noël
>>
>
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: regarding patch 38838

2013-02-17 Thread Prashant Pandey
Hi Jean,

Thanks for help !

Finally, I did : *aRealStyle.copy(0,(aRealStyle.Search(aSep) + aSep.Len()));
*

It also worked :)

Thanks once again!

-Prashant

On Sun, Feb 17, 2013 at 11:11 PM, Jean-Noël Rouvignac <
jn.rouvig...@gmail.com> wrote:

> Hi Prashant,
>
> 2013/2/17 Prashant Pandey 
>
>> Hi,
>>
>>>
>>> I need some guidance as am stuck at a place.
>>> How should I replace 'erase' using guidelines given under
>>> https://wiki.documentfoundation.org/Development/String_Classes.
>>> If I try to fit 'replaceAt' in place of 'erase' in the line bolded below:
>>>
>>> *aRealStyle.Erase(aRealStyle.Search(aSep) + aSep.Len());*
>>>
>>> it will give me error (if I do : 
>>> *aRealStyle.replaceAt(aRealStyle.indexOf(aSep)
>>> + aSep.getLength());*)
>>>
>>> Reason:
>>>
>>> replaceAt defined as: rtl::OUString rtl::OUString::replaceAt(sal_Int32,
>>> sal_Int32, const rtl::OUString&) const
>>> (candidate expects 3 arguments, 1 provided)
>>> error: no matching function for call to
>>> ‘rtl::OUString::replaceAt(sal_Int32)
>>>
>>> My question is, what should I pass inside the replaceAt()
>>> parameters/arguments?
>>>
>>
> I would suggest you write this:
> *sal_int32 idx = **aRealStyle.indexOf(aSep) + aSep.getLength();*
> ***aRealStyle = aRealStyle.replaceAt(idx, **aRealStyle.getLength() - *
> *aRealStyle, "");*
>
> Because:
>
>- If nIndex is set then can use replaceAt with an arg of an empty
>string (from the wiki page)
>- The second argument is the count, and here we replace until the end
>of the string
>- Since OUString is immutable, you must assign back the resulting
>OUString if you do not want to lose it
>
> Cheers,
>
> Jean-Noël
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: regarding patch 38838

2013-02-17 Thread Jean-Noël Rouvignac
Hi Prashant,

2013/2/17 Prashant Pandey 

> Hi,
>
>>
>> I need some guidance as am stuck at a place.
>> How should I replace 'erase' using guidelines given under
>> https://wiki.documentfoundation.org/Development/String_Classes.
>> If I try to fit 'replaceAt' in place of 'erase' in the line bolded below:
>>
>> *aRealStyle.Erase(aRealStyle.Search(aSep) + aSep.Len());*
>>
>> it will give me error (if I do : 
>> *aRealStyle.replaceAt(aRealStyle.indexOf(aSep)
>> + aSep.getLength());*)
>>
>> Reason:
>>
>> replaceAt defined as: rtl::OUString rtl::OUString::replaceAt(sal_Int32,
>> sal_Int32, const rtl::OUString&) const
>> (candidate expects 3 arguments, 1 provided)
>> error: no matching function for call to
>> ‘rtl::OUString::replaceAt(sal_Int32)
>>
>> My question is, what should I pass inside the replaceAt()
>> parameters/arguments?
>>
>
I would suggest you write this:
*sal_int32 idx = **aRealStyle.indexOf(aSep) + aSep.getLength();*
***aRealStyle = aRealStyle.replaceAt(idx, **aRealStyle.getLength()
- **aRealStyle,
"");*

Because:

   - If nIndex is set then can use replaceAt with an arg of an empty string
   (from the wiki page)
   - The second argument is the count, and here we replace until the end of
   the string
   - Since OUString is immutable, you must assign back the resulting
   OUString if you do not want to lose it

Cheers,

Jean-Noël
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: regarding patch 38838

2013-02-16 Thread Jean-Noël Rouvignac
2013/2/16 Prashant Pandey 

> Hi Jean-Noel,
>
> I am an undergrad student from India, new to the open source world, and
> trying contribute something good and productive to it.
>
> I am happy to see you actively work on Patch 38838 :) and am also working
> on the same patch since last few days and trying hard to get touch with it
> comfortably. However, things are not going in their best way.
>
> Can you help me with fixing the same bug and getting me more comfortable
> with it.
> What is the way to replace String with OUString. Is it anywhere I see
> them, I just need to replace them or there are other factors also I need to
> take them under consideration?
>
> I shall be grateful to you for being patient and helping/guiding me for
> the same :)
> Waiting for your earliest reply
>
> Thanks and Regards
> Prashant Pandey
>


Hi Prashant,

Welcome on board! The more people work on this bug the faster it will be
solved and it is a big one.
I suggets you take a look at this page:
https://wiki.documentfoundation.org/Development/String_Classes

It outlines how to replace String/UniString/XubString (the 2 latter are
#define's of String) with OUString.
You can also take a look at the doc for OUString (
http://api.libreoffice.org/docs/cpp/ref/classrtl_1_1_o_u_string.html ) and
OUStringBuffer (
http://api.libreoffice.org/docs/cpp/ref/classrtl_1_1_o_u_string_buffer.html).
Since OUString is immutable it is to be used when a String does not change
or not much, while OUStringBuffer is to be used to build an OUString.

I suggest you read these pages and take a look at previous commits on
http://cgit.freedesktop.org/libreoffice/core/log/ where you can do queries
to find the relevant commits.

Also I suggest you subscribe to the developer's mailing list and ask your
questions regarding this bug there.

Thanks and good luck!
Jean-Noël
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice