Resolves: rhbz#1861794 missing csv fixed width handles

f41
Caolán McNamara 4 years ago
parent 40097e0e1c
commit 0d57d1f7cc

@ -0,0 +1,123 @@
From 937d1d5be8d0c783fb5740aa50456f9941ac638b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 29 Jul 2020 21:05:27 +0100
Subject: [PATCH] rhbz#1861794 csv fixed width import missing split handle
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
regression from...
commit 1e97ca02773e2ba968606eed61d25d88f0d7e417
Author: Caolán McNamara <caolanm@redhat.com>
Date: Mon Oct 14 11:05:07 2019 +0100
EndMouseTracking was left uncalled
Change-Id: Ia952addac585737c3d3aa4fd68d772c3acbae848
---
sc/source/ui/dbgui/csvruler.cxx | 36 ++++++++++++++++-----------------
sc/source/ui/inc/csvruler.hxx | 7 ++++---
2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 294f22526974..9fe9f6433359 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -106,7 +106,7 @@ void ScCsvRuler::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
ScCsvControl::SetDrawingArea(pDrawingArea);
- mnSplitSize = (GetCharWidth() * 3 / 5) | 1; // make an odd number
+ UpdateSplitSize();
Size aSize(1, GetTextHeight() + mnSplitSize + 2);
pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
@@ -162,10 +162,17 @@ void ScCsvRuler::InitColors()
InvalidateGfx();
}
+void ScCsvRuler::UpdateSplitSize()
+{
+ mnSplitSize = (GetCharWidth() * 3 / 5) | 1; // make an odd number
+}
+
void ScCsvRuler::InitSizeData()
{
maWinSize = GetOutputSizePixel();
+ UpdateSplitSize();
+
sal_Int32 nActiveWidth = std::min( GetWidth() - GetHdrWidth(), GetPosCount() * GetCharWidth() );
sal_Int32 nActiveHeight = GetTextHeight();
@@ -409,7 +416,11 @@ bool ScCsvRuler::MouseButtonDown( const MouseEvent& rMEvt )
bool ScCsvRuler::MouseButtonUp( const MouseEvent& )
{
- mbTracking = false;
+ if (mbTracking)
+ {
+ EndMouseTracking();
+ mbTracking = false;
+ }
return true;
}
@@ -498,24 +509,11 @@ void ScCsvRuler::MoveMouseTracking( sal_Int32 nPos )
}
}
-void ScCsvRuler::EndMouseTracking( bool bApply )
+void ScCsvRuler::EndMouseTracking()
{
- if( bApply ) // tracking finished successfully
- {
- // remove on simple click on an existing split
- if( (mnPosMTCurr == mnPosMTStart) && maOldSplits.HasSplit( mnPosMTCurr ) && !mbPosMTMoved )
- Execute( CSVCMD_REMOVESPLIT, mnPosMTCurr );
- }
- else // tracking cancelled
- {
- MoveCursor( mnPosMTStart );
- // move split to origin
- if( maOldSplits.HasSplit( mnPosMTStart ) )
- MoveMouseTracking( mnPosMTStart );
- // remove temporarily inserted split
- else if( !maOldSplits.HasSplit( mnPosMTCurr ) )
- Execute( CSVCMD_REMOVESPLIT, mnPosMTCurr );
- }
+ // remove on simple click on an existing split
+ if( (mnPosMTCurr == mnPosMTStart) && maOldSplits.HasSplit( mnPosMTCurr ) && !mbPosMTMoved )
+ Execute( CSVCMD_REMOVESPLIT, mnPosMTCurr );
mnPosMTStart = CSV_POS_INVALID;
}
diff --git a/sc/source/ui/inc/csvruler.hxx b/sc/source/ui/inc/csvruler.hxx
index 32d72ef93b8f..0913ac09271f 100644
--- a/sc/source/ui/inc/csvruler.hxx
+++ b/sc/source/ui/inc/csvruler.hxx
@@ -137,9 +137,8 @@ private:
void StartMouseTracking( sal_Int32 nPos );
/** Moves tracking to a new position. */
void MoveMouseTracking( sal_Int32 nPos );
- /** Applies tracking action for the current tracking position.
- @param bApply sal_True = apply action, sal_False = cancel action. */
- void EndMouseTracking( bool bApply );
+ /** Applies tracking action for the current tracking position */
+ void EndMouseTracking();
// painting ---------------------------------------------------------------
protected:
@@ -154,6 +153,8 @@ private:
sal_Int32 GetWidth() const { return maWinSize.Width(); }
/** Returns the height of the control. */
sal_Int32 GetHeight() const { return maWinSize.Height(); }
+ /** Update the split size depending on the last width set by CSVCMD_SETCHARWIDTH */
+ void UpdateSplitSize();
/** Draws the background and active area to maBackgrDev (only the given X range). */
void ImplDrawArea( sal_Int32 nPosX, sal_Int32 nWidth );
--
2.26.2

@ -50,7 +50,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice Name: libreoffice
Epoch: 1 Epoch: 1
Version: %{libo_version}.2 Version: %{libo_version}.2
Release: 4%{?libo_prerelease}%{?dist} Release: 5%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0 License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0
URL: http://www.libreoffice.org/ URL: http://www.libreoffice.org/
@ -244,6 +244,7 @@ Patch4: 0001-fix-detecting-qrcodegen.patch
Patch5: 0001-Flatpak-Add-app-bin-libreoffice-app-libreoffice-prog.patch Patch5: 0001-Flatpak-Add-app-bin-libreoffice-app-libreoffice-prog.patch
Patch6: 0001-Restructure-solenv-bin-assemble-flatpak.sh.patch Patch6: 0001-Restructure-solenv-bin-assemble-flatpak.sh.patch
Patch7: 0001-Related-tdf-127782-resize-the-print-dialog-to-its-op.patch Patch7: 0001-Related-tdf-127782-resize-the-print-dialog-to-its-op.patch
Patch8: 0001-rhbz-1861794-csv-fixed-width-import-missing-split-ha.patch
%if 0%{?rhel} %if 0%{?rhel}
# not upstreamed # not upstreamed
@ -2231,6 +2232,9 @@ done
%{_includedir}/LibreOfficeKit %{_includedir}/LibreOfficeKit
%changelog %changelog
* Wed Jul 29 2020 Caolán McNamara <caolanm@redhat.com> - 1:6.4.5.2-5
- Resolves: rhbz#1861794 missing csv fixed width handles
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:6.4.5.2-4 * Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:6.4.5.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

Loading…
Cancel
Save