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


Hi Sagar,

[ CC'ing the dev list, that's the place to ask question like this. ]

On Wed, Sep 19, 2012 at 08:48:34AM +0300, Sagar Srivastava <sagar.libo@gmail.com> wrote:
In the following file :

*filter/source/pdf/impdialog.cxx*

Check out the piece of code inside the following method :

*ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent,
                                            const SfxItemSet& rCoreSet
                                            ) :
    SfxTabPage( pParent, PDFFilterResId( RID_PDF_TAB_GENER ), rCoreSet ),

    maFlPages( this, PDFFilterResId( FL_PAGES ) ),
    maRbAll( this, PDFFilterResId( RB_ALL ) ),
    maRbRange( this, PDFFilterResId( RB_RANGE ) ),
    maRbSelection( this, PDFFilterResId( RB_SELECTION ) ),
    maEdPages( this, PDFFilterResId( ED_PAGES ) ),*

Requirement :

I want to change the macro "*RB_RANGE*" to another e.g. *RB_RANGE_IMPRESS*
at runtime, if the source document is a presentation document implying
"*if (mbIsPresentation)*".

Any Idea for it ???

I didn't find any mechanism to change the macro at runtime yet.

Not exactly sure what you mean, but in general, if you want to make the
initialization of a member conditional, then do it inside the
constructor body -- something like:

ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent, const SfxItemSet& rCoreSet )
    : <normal init here>
{
    if (mbIsPresentation)
        maRbRange = Radiobutton( this, PDFFilterResId( RB_RANGE_IMPRESS ) )
    else
        maRbRange = Radiobutton( this, PDFFilterResId( RB_RANGE ) )
}

Or you can avoid the double-initialization with adding a setResId()
method, so the resource id can be set later, after the ctor is already
called.

Miklos

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.