[Libreoffice-bugs] [Bug 133497] New: OApplicationController::elementReplaced effectively does nothing

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri May 29 12:00:29 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=133497

            Bug ID: 133497
           Summary: OApplicationController::elementReplaced effectively
                    does nothing
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: sbergman at redhat.com
                CC: lionel at mamane.lu

<https://git.libreoffice.org/core/+/760c03c8ee16ecfa7620174c0eabc9812cba9a83%5E!/>
"INTEGRATION: CWS insight01" had introduced
OApplicationController::elementReplaced in
dbaccess/source/ui/app/AppController.cxx as

> +void SAL_CALL OApplicationController::elementReplaced( const ContainerEvent& _rEvent ) throw(RuntimeException)
> +{
> +    ::vos::OGuard aSolarGuard(Application::GetSolarMutex());
> +    ::osl::MutexGuard aGuard(m_aMutex);
> +
> +    Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY);
> +    if ( xNames == m_xCurrentContainer || ::std::find(m_aCurrentSubContainers.begin(),m_aCurrentSubContainers.end(),Reference< XContainer >(xNames,UNO_QUERY)) != m_aCurrentSubContainers.end() )
> +    {
> +        OSL_ENSURE(getContainer(),"View is NULL! -> GPF");
> +        ::rtl::OUString sName;
> +        try
> +        {
> +            _rEvent.Accessor >>= sName;
> +            Reference<XConnection> xConnection;
> +            Reference<XPropertySet> xProp(_rEvent.Element,UNO_QUERY);
> +            ::rtl::OUString sNewName;
> +
> +            ElementType eType = getContainer()->getElementType();
> +            switch( eType )
> +            {
> +                case E_TABLE:
> +                    ensureConnection(xConnection);
> +                    if ( xProp.is() && xConnection.is() )
> +                    {
> +                        sNewName = ::dbaui::composeTableName(xConnection->getMetaData(),xProp,sal_False,::dbtools::eInDataManipulation);
> +                    }
> +                    break;
> +                case E_FORM:
> +                case E_REPORT:
> +                    {
> +                        Reference<XContent> xContent(xNames,UNO_QUERY);
> +                        if ( xContent.is() )
> +                        {
> +                            sName = xContent->getIdentifier()->getContentIdentifier() + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + sName;
> +                        }
> +                    }
> +                    break;
> +            }
> +            //  getContainer()->elementReplaced(getContainer()->getElementType(),sName,sNewName,xConnection);
> +        }
> +        catch( Exception& )
> +        {
> +            OSL_ENSURE(0,"Exception catched");
> +        }
> +    }
> +}

with the call to getContainer()->elementReplaced(...) commented out right from
the start (and the code is still effectively the same today at
<https://git.libreoffice.org/core/+/6647a167400753df45dba788ed793d55ca0be9f8/dbaccess/source/ui/app/AppController.cxx#1537>).

That means that all the code in that function effectively does nothing, except
for potentially relevant side effects hidden behind any of its function calls.

The question is whether the function should be removed, or the commented-out
code be enabled.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200529/0fdef079/attachment.htm>


More information about the Libreoffice-bugs mailing list