summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorgokaysatir <gokaysatir@collabora.com>2020-09-30 15:48:44 +0300
committerSzymon Kłos <szymon.klos@collabora.com>2020-10-12 09:12:49 +0200
commit53bd76e8f193baf667077eb52d06e3c244964819 (patch)
treef6be3a7f86aaa573ed025c93156cbceb04f46764 /sc/source/ui
parentb47a8eda6ecd2b508054a68b4879c769cce87363 (diff)
Online: Hide right clicked sheet.
On core side, if user clicks on a tab with right mouse button, clicked tab is selected. So, for core side, if this feature will be desired, some more modification will be needed. Change-Id: Ic4755b27b8ba98d3a6aa086b2e0a3566d095ba16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103685 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104078 Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/viewfunc.hxx2
-rw-r--r--sc/source/ui/view/tabvwshf.cxx20
-rw-r--r--sc/source/ui/view/viewfun2.cxx6
3 files changed, 25 insertions, 3 deletions
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 7780e74bc790..5a7ad681c628 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -285,7 +285,7 @@ public:
const OUString& rSource );
void ShowTable( const std::vector<OUString>& rNames );
- void HideTable( const ScMarkData& rMark );
+ void HideTable( const ScMarkData& rMark, SCTAB nTabToSelect = -1);
void MakeScenario(const OUString& rName, const OUString& rComment,
const Color& rColor, ScScenarioFlags nFlags);
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 95e566267ae1..98ce2db58fa7 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -107,7 +107,25 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if ( rDoc.IsDocEditable() )
{
ScMarkData& rMark = rViewData.GetMarkData();
- HideTable( rMark );
+ SCTAB nActiveTab = -1;
+ // For the cases when user right clicks on a non-active tab and hides it. This case is possible for Online.
+ if (pReqArgs)
+ {
+ const SfxPoolItem *pItem;
+ if( pReqArgs->HasItem( FID_TABLE_HIDE, &pItem ) )
+ {
+ SCTAB nTabNumber = static_cast<const SfxInt16Item*>(pItem)->GetValue();
+ // Does selected sheets (tabs) list include the sheet to be hidden?
+ std::set<SCTAB>::iterator it = rMark.GetSelectedTabs().find(nTabNumber);
+ if (it == rMark.GetSelectedTabs().end())
+ {
+ // No it doesn't, so we won't shift the selected tab. Let's remember its position.
+ nActiveTab = GetViewData().GetTabNo();
+ }
+ rMark.SelectOneTable(nTabNumber);
+ }
+ }
+ HideTable( rMark, nActiveTab );
}
}
break;
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 90ddff57df08..572b62cf4036 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -3146,7 +3146,7 @@ void ScViewFunc::ShowTable( const std::vector<OUString>& rNames )
}
}
-void ScViewFunc::HideTable( const ScMarkData& rMark )
+void ScViewFunc::HideTable( const ScMarkData& rMark, SCTAB nTabToSelect )
{
ScDocShell* pDocSh = GetViewData().GetDocShell();
ScDocument& rDoc = pDocSh->GetDocument();
@@ -3181,6 +3181,10 @@ void ScViewFunc::HideTable( const ScMarkData& rMark )
undoTabs.push_back(nTab);
}
}
+
+ if (nTabToSelect != -1)
+ SetTabNo(nTabToSelect);
+
if (bUndo)
{
pDocSh->GetUndoManager()->AddUndoAction( std::make_unique<ScUndoShowHideTab>( pDocSh, undoTabs, false ) );
cl/backendtest/outputdevice/common.cxx?h=feature/wasm&id=e401a3385ae9dd767bc815085535cd30a658f054'>backendtest: Asymmetrical Filled Drop Like Shape testhomeboy445 Change-Id: Iacf121483aefa71d6f24e14782fcaf22c0d5d56e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118859 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> 2021-08-13cid#1490210 silence Arguments in wrong orderCaolán McNamara Change-Id: I8767fe556142ec7e3254eaff56bbb1b4eb8322e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120462 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2021-08-12backendtest: Closed Bezier loop test using various drawing methodshomeboy445 Change-Id: Ib2ddc8475e2476ce377f3541caa0d48e7c57241a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118783 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> 2021-08-11backendtest:Irregular HalfEllipse test via various drawing methodshomeboy445 Change-Id: If1a6f224f6ff4118617128630077a81da4c469a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118656 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins 2021-08-08cid#1489971 silence Arguments in wrong orderCaolán McNamara Change-Id: Ib4bb02a152443ba83b5019ea618265a9363363a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120173 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2021-08-07backendtest: drop like shape test for polygon / polylinehomeboy445 Add a test for drawing a drop like shape using polygon and polyline drawing code-paths. Change-Id: Ifee7b978009d66af01ccbfc92b36d1423084ed48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118278 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> 2021-04-24backend tests for linecap and linejoin typesLuboš Luňák Change-Id: Id481feb25ce938b4382f970f2e1082a3594c9eca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114560 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> 2020-12-29vcl: move local bitmap headers to inc/bitmap directoryChris Sherlock Change-Id: I72cc28d4df8031e322daa50d79666cabcb6421a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108040 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> 2020-11-17implement also axial gradient for skiaLuboš Luňák Change-Id: Ie708250f970f2ce08c8c89e4bf001a5df23b99bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106015 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> 2020-10-19use tools::Long in vclNoel Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-09-28rename for disentangling AA and B2D use in VCL drawingLuboš Luňák This renames AntialiasingFlags::EnableB2dDraw to just Enable, and the AntiAliasB2DDraw names to just AntiAlias. This is in preparation for a second commit that will actually separate the AA and B2D functionality of these flags. Change-Id: I9cc215c5752dfabce41e00e19d9074fc8dc3d4de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103416 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> 2020-09-25make vclbackendtest test gradientsLuboš Luňák And tweak the tests so that the default VCL algorithm actually passes. Also allow a slight inaccuracy for the starting and ending white and black colors, as the upcoming Cairo and Skia implementations are not precise there. Change-Id: I93bae57c0e168027a52ced0d757ee6925cb5335a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103281 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> 2020-05-26use Skia to do dashed lines, no need to do it manually (tdf#130431)Luboš Luňák Change-Id: Id5efe7227f3c2bcb5ef6f1b990327e72014e8c47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94857 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> 2020-04-01SalInvert::N50 has 1x1 pixel checker size, not 2x2 (tdf#131580)Luboš Luňák This can be seen with widget styles that use invert() to draw focus rectangle, such as with VCL gen or win backends. Change-Id: I7fb36d1be5333e917f871f8504585e32abe82b5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91380 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> 2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2019-11-27avoid some compiler warnings in Skia VCL codeLuboš Luňák Mostly warnings from the 'casttovoid' Clang plugin, which is rather annoying here. Change-Id: I3d69697143f690211cdd26d1b9a4c0efe9397197 2019-11-27use different line and fill color in vcl backendtestLuboš Luňák Having them the same can hide problems with them fixed up incorrectly. And it also shows that drawPolygon() with line color unset does not draw the right-most and bottom-most line, which is what all underlying graphics systems do, so the test is kind of wrong and I've added a compensation to make it visually correct (and match the checked expected result). Change-Id: I333f41210232c74ba55bd5c92ef5fda917ce3e59 2019-11-27backendtest: support creating VirtualDevice with alphaTomaž Vajngerl Change-Id: I74c428b9b31b89536e72d53e418fc11b3f7e4e32 2019-11-27backendtests: enable tests only when render backend is skiaTomaž Vajngerl Change-Id: Idd06da27e405a3c0040bdad69c76537f12e50c92 2019-11-27backendtest: Add polyline bezier curve backend testsTomaž Vajngerl Change-Id: I8cb3e97de79cbd683a266b09fb7d194c07b0089f 2019-11-27backendtests: remove unused variable - aReturnValueTomaž Vajngerl Change-Id: I1a2ef490ad0ae6f431f8b4c40c27c7829c51e08d 2019-11-27add "invert" tests to BackendTestTomaž Vajngerl All backend tests are not enabled yet as none of the backends pass, but testDrawInvertWithRectangle and testDrawInvertN50WithRectangle should pass with skia backend. testDrawInvertTrackFrameWithRectangle is more complicated as drawing an inverted dashed frame around overshoots outside of the rectangle area (as with gtk3 backend, maybe others too). This is something we need to fix or better yet to get rid of this invert mode. Change-Id: Ibc08ff99d91014c41324b67e8e984111bcd3c7ac 2019-05-13Make BitmapColor inherit from / merge into ColorJan-Marek Glogowski BitmapColor itself is kept to distingish the Color usage as part of a color palette, which continues to store the offset in the blue value. The original special mbIndex handling is long gone since commit 1fefdd6f3b41 ("Alpha channel in BitmapColor - change bIndex to alpha"), so there is no data difference. This also results in the following changes: * now has a basic_ostream<charT, traits>& operator<< (that was my actual starting point... for an other bug fix) * there is a minimal difference for GetLiminance BGR(29,151,76) => BGR(28,151,77) * no more return values for Merge and Invert (previously returning *this) * replaces all GetBlueOrIndex with GetIndex This leaves one "problematic" part: the GetColorError handling. At first glance it should probably be virtual. The Color variant is less strict then the BitmapColor one - for whatever reason. BitmapColor is always used to search for the best match in a Palette. Currently I'm simply leaving both variants. Would be nice to have an explict for functions here. Change-Id: I251ba3024a1d60f2a9d9fde9cd0a60f08e8322a7 Reviewed-on: https://gerrit.libreoffice.org/72181 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> 2019-04-16Add backend tests as CPPUNIT testsTomaž Vajngerl This (finally) adds backend tests as CPPUNIT tests too. In the future they'll also be added into LibreOffice directly as a way to test if the backend is OK, which will be useful especially for the OpenGL backend, which draw quality depends on the driver. Currently all the tests are ignored because of the bugs in the backend, which need to be addressed first and tests then can be enabled one by one. The main reason for the test is to identify issues when drawing is done at a wrong position, which is a very common problem. Also other types of tests will be added in time, which will have a big role in the refactoring of VCL that will happen in the future. Change-Id: I92237d47d49fa0db01b73b8bc39f7a621b65961e Reviewed-on: https://gerrit.libreoffice.org/70769 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> 2018-11-01clang-tidy: (WIP) bugprone-too-small-loop-variable findingsTamás Zolnai Change-Id: Iaa255b39928ac45dec1ed37e368c149d6027f561 Reviewed-on: https://gerrit.libreoffice.org/62701 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> 2018-03-15move Bitmap::ScopedWriteAccess inside vclNoel Grandin would have liked to make the AcquireWriteAccess methods DLLPRIVATE, but they are needed by the workbench and testing code Change-Id: I22497788eb68dfb84b7e542e5ef53322892a5274 Reviewed-on: https://gerrit.libreoffice.org/51310 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> 2018-02-28convert COL_ constants to be of type ColorNoel Grandin Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48 Reviewed-on: https://gerrit.libreoffice.org/50373 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> 2018-02-05vcl: remove BitmapColor Color() operatorChris Sherlock BitmapColor has a Color() operator. However, this is confusing and tends to hide that the two classes aren't the same. I have converted this to GetColor(). Change-Id: I0be2dcb3fc420e7be9c8d04330e7a3fe69a5412a Reviewed-on: https://gerrit.libreoffice.org/48245 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com> 2017-10-23loplugin:includeform: vclStephan Bergmann Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea 2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> 2016-08-25Resolves: coverity#1371769 'Constant' variable guards dead codeCaolán McNamara Change-Id: I95e829ecc685603e147e68b44cb403d4f010e320 2016-08-23vcl: Adds backend tests to check for correct renderingTomaž Vajngerl Collection of test that check rendering of VCL backend. This works by rendering primitives to the VirtualDevice, outputing the result to a Bitmap and checking the rendering by comparing pixels. This should warn when the primitive is drawn to a wrong position or if it is the wrong size or color. It also test some rendering tricks like XOR drawing. Currently this is not implemented as a CPPUnit test but separately, as its own executable file so we can check the results visually. The idea is also to add the tests into LO for the user to test or automatically to test the backend on first start (especially useful to test the OpenGL backend as some drivers could have unexpected behaviour). Change-Id: I2a565b9986ca68850e2752466e3cd5fc71991ba6