sw/source/uibase/uiview/view.cxx |    3 ---
 1 file changed, 3 deletions(-)

New commits:
commit c123bfff501229f398a1b679fc7434b82d53685c
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Thu Aug 20 22:58:24 2020 +0300
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Sun Aug 23 22:40:33 2020 +0200

    Bin overly eager early return that stops replacement image creation
    
    The return causes a customer's Java code that handles some .odt
    document to unexpectedly not create object replacement images in the
    document.
    
    The problem is that in the bad case, the SwTextShell is created later
    than .uno:UpdateAll is dispatched, so the dispatch does nothing.
    SwBaseShell::Execute() for FN_UPDATE_ALL is not called. And this is
    required, becase that calls setUserAllowsLinkUpdate(true), so that on
    save, when EmbeddedObjectContainer::StoreAsChildren() in comphelper/
    hits the 'if ( !xStream.is() && getUserAllowsLinkUpdate() )'
    condition, then we create a replacement image.
    
    This is a Basic script that demonstrates the same issue:
    
    desktop = CreateUnoService("com.sun.star.frame.Desktop")
    Dim props(0) as new com.sun.star.beans.PropertyValue
    props(0).Name = "Hidden"
    props(0).Value = true
    component = desktop.loadComponentFromURL("file:///.../test.odt", 
"_default", 0, props)
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    frame = component.CurrentController.Frame
    dispatcher.executeDispatch(frame, ".uno:UpdateAll", "", 0, Array())
    component.storeSelf(Array())
    component.dispose()
    
    (Will also try to add a unit test that demonstrates the problem and
    verifies this fix.)
    
    Change-Id: I4a5f78a2118a387f062c2d5213a0012a7df2dd9f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101138
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 5ee6f15b65a9..b93880751bd0 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1385,9 +1385,6 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < 
beans::PropertyValue >
         return;
 
     Point aCursorPos( nX, nY );
-    const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? 
DOCUMENTBORDER : DOCUMENTBORDER*2;
-    if (nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
-        return;
 
     m_pWrtShell->EnableSmooth( false );
     const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to