diff options
author | Jim Raykowski <raykowj@gmail.com> | 2022-07-12 12:34:25 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2022-07-30 05:24:38 +0200 |
commit | d87f69cc7e5a6f5c8a79075fed343a14675f3a5d (patch) | |
tree | 3142fbf4b0952121a693762502c5cf366e122268 | |
parent | 597d21d0d03b3dd229f725b4106c5df7cecb65d6 (diff) |
tdf#118696 better fix for sd Navigator object selection
resulting in unexpected view movement
This fix reverts commit 3c86ffd8ded628e6f2b4187948a1b1056f6a0f56 and
reintroduces DrawViewShell::MakeVisible with change made to the
passed object rectangle always being the snap rectangle instead of
the rectangle returned from a call to object GetLogicRect.
Change-Id: I05e777545fb1093838c05618e87ad4d4f5ec003c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137008
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
-rw-r--r-- | sd/source/ui/docshell/docshel4.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 6fe599e44197..efc3d1bd97cd 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -74,7 +74,8 @@ #include <framework/FrameworkHelper.hxx> #include <o3tl/string_view.hxx> -#include <sfx2/zoomitem.hxx> +#include <Window.hxx> +#include <svl/intitem.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -835,17 +836,11 @@ void DrawDocShell::GotoBookmark(std::u16string_view rBookmark) pDrawViewShell->SwitchPage(nSdPgNum); } - if (pDrawViewShell->GetDispatcher()) - { - // show page - SvxZoomItem aZoom; - aZoom.SetType( SvxZoomType::WHOLEPAGE ); - pDrawViewShell->GetDispatcher()->ExecuteList(SID_ATTR_ZOOM, SfxCallMode::ASYNCHRON, { &aZoom }); - } - if (pObj != nullptr) { - // select object + // show and select object + if (vcl::Window* pWindow = pDrawViewShell->GetActiveWindow()) + pDrawViewShell->MakeVisible(pObj->GetSnapRect(), *pWindow); pDrawViewShell->GetView()->UnmarkAll(); pDrawViewShell->GetView()->MarkObj( pObj, |