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


Hi all,
I stumbled in the following code snippet in SfxViewFrame::LoadViewIntoFrame_Impl:

    OUString sURL( "private:object"  );
    if ( sURL.isEmpty() )
        sURL = i_rDoc.GetFactory().GetFactoryURL();

in which the "if" test is obviously always false. I looked at how code evolved during development and, apart for some OUString reworking, the main changes are:

1. Commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=9fb19fd9f062adc0bb778258c5e65d57ff794e09 introduced GetFactoryURL() and simplified the original code into:

    ::rtl::OUString sURL( xDocument->getURL() );
    if ( !sURL.getLength() )
        sURL = i_rDoc.GetFactory().GetFactoryURL();

also adding a similar flow in SfxFrame::Create (sfx2/source/view/frame2.cxx)

2. Commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=c44ba0727fecc1a1a70f525e72b0854527ab3e22 replaced (and this is the whole commit) all of the 3 lines with just:

::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );

3. Commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=a8f1ad65612c0e54969cabc541b183062ae3d905 added back the "if":

::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );
    if ( sURL.isEmpty() )
        sURL = i_rDoc.GetFactory().GetFactoryURL();

and strangely replaced the similar code in SfxFrame::Create with the same "fix" used in commit 2 (might it be a mis-merge?).

My guess is that the "if" in the code under consideration can be removed since such code was untouched for so long but I have no idea about what this code is menat to do. Does anybody have a clue on what this code is supposed to do and on how to proceed?

Many thanks and kind regards
Matteo

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.