qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java | 12 +++++----- qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java | 4 +-- sw/source/uibase/uno/unomod.cxx | 2 - 3 files changed, 9 insertions(+), 9 deletions(-)
New commits: commit 6287a4f0d18df7f195d1f14b7c24536317463a23 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Feb 5 20:40:54 2019 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Feb 7 09:21:50 2019 +0100 [API CHANGE] Synchronize supported Writer document zoom ranges On the one hand, SvxZoomSliderItem/SvxZoomSliderControl as used by SwView's SID_ATTR_ZOOMSLIDER support a range from MINZOOM (20) to MAXZOOM (600) (defined in sw/inc/view.hxx). Setting a zoom value outside that range for one causes the DBG_ASSERT "Looks like the zoom slider item is corrupted" in SvxZoomSliderControl::StateChanged (svx/source/stbctrls/zoomsliderctrl.cxx) to fire, and for another (when setting a too small value) tries to assign a negative value (which wraps around, and gets flagged by Clang's -fsanitize=implicit-signed-integer-truncation) to sal_uInt16 nCurrentZoom at nCurrentZoom = nCurrentZoom - mxImpl->mnMinZoom; in SvxZoomSliderControl::Zoom2Offset (svx/source/stbctrls/zoomsliderctrl.cxx). On the other hand, SwXViewSettings' support of css.text.ViewSettings' ZoomValue property allowed values in the range from 5 to 1000 (cf. SwXViewSettings::_setSingleValue in sw/source/uibase/uno/unomod.cxx), and some JunitTests actually set such values (10, 15) below the MINZOOM value of 20. The incompatible 5--1000 range was there ever since 7b0b5cdfeed656b279bc32cd929630d5fc25878b "initial import", but looks rather random, so change it to match the 20--600 range instead. (And lets flag this as an [API CHANGE], to be on the safe side.) One of the JunitTests files that needed to be adapted, qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java, oddly mentioned a zoom value of 130% in a comment while using the value 15 in the actual code. (And did so ever since the test code's introduction in 26ebdfc472be16f0eb4110aab0335666d2ba5e62 "NEW: initial version".) Changing the code to 130 would cause JunitTest_sw_unoapi_1 to fail in strange ways, with disposed UNO objects, while changing the code (and comment) to 21 appears to work. Go figure. Change-Id: Id944ffdce501448312e008436e7038bf2aec63ac Reviewed-on: https://gerrit.libreoffice.org/67427 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java index 15c42c68310d..9d12789ca1e8 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java @@ -83,9 +83,9 @@ public class SwAccessibleEndnoteView extends TestCase { xController); XPropertySet xPropSet = xViewSetSup.getViewSettings(); - //change zoom value to 10% + //change zoom value to 20% //footer should be in the vissible area of the document - xPropSet.setPropertyValue("ZoomValue", Short.valueOf("10")); + xPropSet.setPropertyValue("ZoomValue", Short.valueOf("20")); XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -105,10 +105,10 @@ public class SwAccessibleEndnoteView extends TestCase { new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { try { - //change zoom value to 130% - PropSet.setPropertyValue("ZoomValue", Short.valueOf("15")); - //and back to 10% - PropSet.setPropertyValue("ZoomValue", Short.valueOf("10")); + //change zoom value to 21% + PropSet.setPropertyValue("ZoomValue", Short.valueOf("21")); + //and back to 20% + PropSet.setPropertyValue("ZoomValue", Short.valueOf("20")); } catch ( com.sun.star.lang.WrappedTargetException e ) { } catch ( com.sun.star.lang.IllegalArgumentException e ) { diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java index 0292396eaa80..f3b23fbdf7cc 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java @@ -104,8 +104,8 @@ public class SwAccessibleTextGraphicObject extends TestCase { new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { try { - //change zoom value to 15% - PropSet.setPropertyValue("ZoomValue", Short.valueOf("15")); + //change zoom value to 20% + PropSet.setPropertyValue("ZoomValue", Short.valueOf("20")); //and back to 100% PropSet.setPropertyValue("ZoomValue", Short.valueOf("100")); } catch ( com.sun.star.lang.WrappedTargetException e ) { diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 54c2c3a50940..83b5f7adbff5 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -629,7 +629,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c case HANDLE_VIEWSET_ZOOM : { sal_Int16 nZoom = 0; - if(!(rValue >>= nZoom) || nZoom > 1000 || nZoom < 5) + if(!(rValue >>= nZoom) || nZoom > MAXZOOM || nZoom < MINZOOM) throw lang::IllegalArgumentException(); mpViewOption->SetZoom(static_cast<sal_uInt16>(nZoom)); mbApplyZoom = true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits