[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source sd/source

2021-12-02 Thread Gabor Kelemen (via logerrit)
 sc/source/ui/drawfunc/fuins1.cxx |4 +++-
 sd/source/ui/func/fuinsert.cxx   |4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 1e1b1d63028fd1328ed8cd72b5e2d6721bf08a73
Author: Gabor Kelemen 
AuthorDate: Tue Nov 30 11:15:08 2021 +0100
Commit: Xisco Fauli 
CommitDate: Thu Dec 2 10:06:56 2021 +0100

tdf#145819 Revert logic of the image-with-rotation dialog: sc & sd

Change-Id: I906e83ada98fd7a583872a2eaa76d7fd04a5401b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126110
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit 970cbb120a62e952e80348b8e94478600241273a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126144

diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 31b597e9ea19..5c7bac6ce2a6 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -113,7 +113,9 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
 if (aRotation)
 {
 std::unique_ptr 
xQueryBox(Application::CreateMessageDialog(nullptr, 
VclMessageType::Question,VclButtonsType::YesNo,ScResId(STR_QUERYROTATION)));
-if (xQueryBox->run() == RET_YES)
+// tdf#145819 Apply the rotation information if the user does NOT 
want to unrotate the image
+// If they chose Yes we ignore the rotation
+if (xQueryBox->run() == RET_NO)
 {
 GraphicNativeTransform aTransform( rGraphic1 );
 aTransform.rotate( aRotation );
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 01434b40f141..d51a580ff081 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -148,7 +148,9 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
 if (aRotation)
 {
 std::unique_ptr 
xQueryBox(Application::CreateMessageDialog(nullptr, 
VclMessageType::Question,VclButtonsType::YesNo,SdResId(STR_QUERYROTATION)));
-if (xQueryBox->run() == RET_YES)
+// tdf#145819 Apply the rotation information if the user does 
NOT want to unrotate the image
+// If they chose Yes we ignore the rotation
+if (xQueryBox->run() == RET_NO)
 {
 GraphicNativeTransform aTransform( aGraphic );
 aTransform.rotate( aRotation );


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source sd/source

2021-06-22 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/editsh.hxx|   12 
 sc/source/ui/inc/tabvwsh.hxx   |6 ++
 sc/source/ui/view/editsh.cxx   |   23 ++-
 sc/source/ui/view/gridwin.cxx  |   14 ++
 sc/source/ui/view/tabvwshe.cxx |   20 
 sd/source/ui/inc/DrawViewShell.hxx |5 -
 sd/source/ui/view/drviews4.cxx |7 ++-
 sd/source/ui/view/drviews7.cxx |2 +-
 8 files changed, 85 insertions(+), 4 deletions(-)

New commits:
commit 66e234549a15cad1b5b61661fb28c7f827ed6e8b
Author: Caolán McNamara 
AuthorDate: Tue Jun 22 11:52:53 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 22 15:29:02 2021 +0200

Resolves: tdf#140361 use the DisableEditHyperlink state as of menu launch 
time

at context menu popup time set if the EditHyperlink entry should be
disabled and use that state if queried about it if EditHyperlink is
dispatched from the menu. So ignoring where the mouse currently happens
to be when the menu was dismissed.

The dispatch is done async, if at all, so also trigger an async Query
with Invalidate so at least one Query is ensured to reset the stored
state

similar to tdf#137445 which was for impress/draw

Change-Id: I43a144f1ac0a4db89cc5ab0ebeeae744719f5958
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117636
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/inc/editsh.hxx b/sc/source/ui/inc/editsh.hxx
index fe56777fbb84..5fb8a3c9ade8 100644
--- a/sc/source/ui/inc/editsh.hxx
+++ b/sc/source/ui/inc/editsh.hxx
@@ -42,6 +42,12 @@ private:
 boolbPastePossible;
 boolbIsInsertMode;
 
+// tdf#140361 at context menu popup time set if the EditHyperlink entry
+// should be disabled and use that state if queried about it if
+// EditHyperlink is dispatched from the menu. So ignoring where the mouse
+// currently happens to be when the menu was dismissed.
+std::optional moAtContextMenu_DisableEditHyperlink;
+
 const SvxURLField* GetURLField();
 ScInputHandler* GetMyInputHdl();
 
@@ -73,6 +79,12 @@ public:
 voidGetUndoState(SfxItemSet );
 
 OUString GetSelectionText( bool bWholeWord );
+
+/// return true if "Edit Hyperlink" in context menu should be disabled
+bool ShouldDisableEditHyperlink() const;
+/// force "Edit Hyperlink" to true, with the expectation that 
SID_EDIT_HYPERLINK is
+/// later Invalidated to reset it back to its natural value
+void EnableEditHyperlink();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 7a5ddf472803..77afb12cd71f 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -399,6 +399,12 @@ public:
 void ClearFormEditData();
 ScFormEditData* GetFormEditData() { return mpFormEditData.get(); }
 
+/// return true if "Edit Hyperlink" in context menu should be disabled
+bool ShouldDisableEditHyperlink() const;
+/// force "Edit Hyperlink" to true, with the expectation that 
SID_EDIT_HYPERLINK is
+/// later Invalidated to reset it back to its natural value
+void EnableEditHyperlink();
+
 virtual tools::Rectangle getLOKVisibleArea() const override;
 };
 
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 451b73a9a208..72abdacd72b8 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -712,6 +712,16 @@ static void lcl_DisableAll( SfxItemSet& rSet )// 
disable all slots
 }
 }
 
+bool ScEditShell::ShouldDisableEditHyperlink() const
+{
+return !rViewData.HasEditView(rViewData.GetActivePart()) || 
!URLFieldHelper::IsCursorAtURLField(*pEditView);
+}
+
+void ScEditShell::EnableEditHyperlink()
+{
+moAtContextMenu_DisableEditHyperlink = false;
+}
+
 void ScEditShell::GetState( SfxItemSet& rSet )
 {
 // When deactivating the view, edit mode is stopped, but the EditShell is 
left active
@@ -777,7 +787,18 @@ void ScEditShell::GetState( SfxItemSet& rSet )
 case SID_COPY_HYPERLINK_LOCATION:
 case SID_REMOVE_HYPERLINK:
 {
-if (!URLFieldHelper::IsCursorAtURLField(*pEditView))
+bool bDisableEditHyperlink;
+if (!moAtContextMenu_DisableEditHyperlink)
+bDisableEditHyperlink = ShouldDisableEditHyperlink();
+else
+{
+// tdf#140361 if a popup menu was active, use the 
state as of when the popup was launched and then drop
+// moAtContextMenu_DisableEditHyperlink
+bDisableEditHyperlink = 
*moAtContextMenu_DisableEditHyperlink;
+moAtContextMenu_DisableEditHyperlink.reset();
+}
+
+if (bDisableEditHyperlink)