Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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:

SdStyleSheet* SdStyleSheet::GetRealStyleSheet()
const/home/elixir/lo/sd/source/core/stlsheet.cxx:429:73:
{
    String aRealStyle;
    String aSep( RTL_CONSTASCII_USTRINGPARAM( SD_LT_SEPARATOR ));
    SdStyleSheet* pRealStyle = NULL;
    SdDrawDocument* pDoc = ((SdStyleSheetPool*)pPool)->GetDoc();

    ::sd::DrawViewShell* pDrawViewShell = 0;

    ::sd::ViewShellBase* pBase = dynamic_cast< ::sd::ViewShellBase* >(
SfxViewShell::Current() );
    if( pBase )
        pDrawViewShell = dynamic_cast< ::sd::DrawViewShell* >(
pBase->GetMainViewShell().get() );

    if (pDrawViewShell && pDrawViewShell->GetDoc() == pDoc)
    {
        SdPage* pPage = pDrawViewShell->getCurrentPage();
        if( pPage )
        {
            aRealStyle = pPage->GetLayoutName();
            // cut after seperator string
*            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?
Please guide me,  i am not getting a clue, trying it for a long time.


Thanks and Regards
Prashant Pandey








On Sat, Feb 16, 2013 at 11:36 PM, Prashant Pandey <
prashant3.yishu@gmail.com> wrote:

Hi Jean,

I really appreciate the help you provided me via these links. And, ya I
definitely agree, its a Big one ! The more number, the sooner it finishes.

Hope to proceed in a good way and submit a patch soon !

Thanks and Regards
Prashant





On Sat, Feb 16, 2013 at 7:33 PM, Jean-Noël Rouvignac <
jn.rouvignac@gmail.com> wrote:

2013/2/16 Prashant Pandey <prashant3.yishu@gmail.com>

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





Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.