[Libreoffice-commits] core.git: 4 commits - sw/source vcl/source
sw/source/core/view/viewsh.cxx |2 ++ sw/source/uibase/docvw/SidebarScrollBar.cxx | 10 ++ sw/source/uibase/docvw/SidebarScrollBar.hxx |2 ++ sw/source/uibase/docvw/SidebarWin.cxx | 10 +- vcl/source/control/scrbar.cxx | 14 +- 5 files changed, 32 insertions(+), 6 deletions(-) New commits: commit de2a6897876976d769504a36abf54eced626b01c Author: Miklos VajnaDate: Tue Nov 24 15:37:29 2015 +0100 sw lok comments: fix map mode state after changing zoom levels Zoom level of SwEditWin is kept in sync with the client, so that the pixel-based comment widgets can be positioned correctly. But that does not mean in general the SwEditWin map mode should not be disabled: so that we don't have to tweak the map mode for each and every postMouseEvent() call and still be able to send them using logic coordinates. Change-Id: I6f686b93d2509d52fdd34e84a502cf04e1ce6e59 diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index c45fd29..229b7a5 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1888,6 +1888,8 @@ void SwViewShell::PaintTile(VirtualDevice , int contextWidth, int contex SwViewOption aOption(*GetViewOptions()); aOption.SetZoom(fScale * 100); ApplyViewOptions(aOption); +// Make sure the map mode (disabled in SwXTextDocument::initializeForTiledRendering()) is still disabled. +GetWin()->EnableMapMode(false); } Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY), commit 7c654ee9d51a752e02c0a972de27d699ab5b649a Author: Miklos Vajna Date: Tue Nov 24 15:20:22 2015 +0100 sw lok comments: avoid crash an exit after clicking the scrollbar Without this, vcl::Window::ImplTrackTimerHdl() will be called on a deleted vcl::Window. Can be reproduced with a comment having a scrollbar in a LOK client, then clicking on the down button of the scrollbar a number of times -> crash on exit. Change-Id: I5d67f96e8baa199f65ec5cf39cb5d39c8162ff33 diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx b/sw/source/uibase/docvw/SidebarScrollBar.cxx index ede4610..9e2c299 100644 --- a/sw/source/uibase/docvw/SidebarScrollBar.cxx +++ b/sw/source/uibase/docvw/SidebarScrollBar.cxx @@ -60,6 +60,11 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* pRectangle) rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } +void SidebarScrollBar::MouseButtonUp(const MouseEvent& /*rMouseEvent*/) +{ +EndTracking(); +} + void SidebarScrollBar::MouseMove(const MouseEvent& rMouseEvent) { TrackingEvent aEvent(rMouseEvent); diff --git a/sw/source/uibase/docvw/SidebarScrollBar.hxx b/sw/source/uibase/docvw/SidebarScrollBar.hxx index ea5639e..0de225b 100644 --- a/sw/source/uibase/docvw/SidebarScrollBar.hxx +++ b/sw/source/uibase/docvw/SidebarScrollBar.hxx @@ -31,6 +31,7 @@ protected: /// @see OutputDevice::LogicInvalidate(). void LogicInvalidate(const Rectangle* pRectangle) override; void MouseMove(const MouseEvent& rMouseEvent) override; +void MouseButtonUp(const MouseEvent& rMouseEvent) override; public: SidebarScrollBar(SwSidebarWin& rSidebarWin, WinBits nStyle, SwView& rView); virtual ~SidebarScrollBar(); commit d562df03098ecb91a89e91ccf69dd6a1eeb98c89 Author: Miklos Vajna Date: Tue Nov 24 15:04:33 2015 +0100 sw lok comments: implement drag of the scrollbar With this, if a comment has a vertical scrollbar, then not only the buttons of the scrollbar can be clicked on, but also the slider of the scrollbar can be dragged. Change-Id: I2e39e18bf60c42a878bb8bfd808f1d47be27eecb diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx b/sw/source/uibase/docvw/SidebarScrollBar.cxx index 909aa76..ede4610 100644 --- a/sw/source/uibase/docvw/SidebarScrollBar.cxx +++ b/sw/source/uibase/docvw/SidebarScrollBar.cxx @@ -60,6 +60,11 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* pRectangle) rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } +void SidebarScrollBar::MouseMove(const MouseEvent& rMouseEvent) +{ +TrackingEvent aEvent(rMouseEvent); +Tracking(aEvent); +} SidebarScrollBar::~SidebarScrollBar() { diff --git a/sw/source/uibase/docvw/SidebarScrollBar.hxx b/sw/source/uibase/docvw/SidebarScrollBar.hxx index 9543205..ea5639e 100644 --- a/sw/source/uibase/docvw/SidebarScrollBar.hxx +++ b/sw/source/uibase/docvw/SidebarScrollBar.hxx @@ -30,6 +30,7 @@ class SidebarScrollBar : public ScrollBar protected: /// @see OutputDevice::LogicInvalidate(). void LogicInvalidate(const Rectangle* pRectangle) override; +void MouseMove(const MouseEvent& rMouseEvent) override; public: SidebarScrollBar(SwSidebarWin&
[Libreoffice-commits] core.git: 4 commits - sw/source vcl/source
sw/source/core/text/guess.cxx |2 - sw/source/core/text/porlay.cxx |2 - vcl/source/gdi/outdev3.cxx | 79 - 3 files changed, 41 insertions(+), 42 deletions(-) New commits: commit 5f89d247e3dac99c297066d404c24dea3312fa51 Author: Khaled Hosny khaledho...@eglug.org Date: Tue Jan 21 18:57:30 2014 +0200 Typo in comment Change-Id: I97252a66da63e25166acf3a7bc5a00ad1f8e94f0 diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx index 04ff05c..2866886 100644 --- a/sw/source/core/text/guess.cxx +++ b/sw/source/core/text/guess.cxx @@ -365,7 +365,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion rPor, SwTxtFormatInfo rInf, // which can corrupt the locale pointer inside pBreakIt. const lang::Locale aLocale = g_pBreakIt-GetLocale( aLang ); -// determines first possible line break from nRightPos to +// determines first possible line break from nCutPos to // start index of current line LineBreakResults aResult = g_pBreakIt-GetBreakIter()-getLineBreak( rInf.GetTxt(), nCutPos, aLocale, commit 82943c758c0cd6a8eb23fc222b4e6a1b55c5571b Author: Khaled Hosny khaledho...@eglug.org Date: Tue Jan 21 17:18:42 2014 +0200 Writer, please stop harassing me This debug code was behind 1 before 9ace8bebd88ff41d65eeaa87a6d1f1dfd8875b6d, so it probably was broken for ages (or even forever), and all it does now is obscure my terminal with hundreds of useless messages whenever I open an RTL document since basically any weak LTR run next to RTL one will have the same script type, but this code warns about it without explaining what one should fix here. I got fed up, whoever knows what to fix here, please do, but for now Iâm just hiding it. Change-Id: Ifa50e47a080f335ef6fe06bc0f0b5ed5ddbc7338 diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 3c73393..a3edbf7 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1245,7 +1245,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode rNode, sal_Bool bRTL ) aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx, ScriptChangeInfo(nEnd, i18n::ScriptType::COMPLEX) ); -#if OSL_DEBUG_LEVEL 0 +#if OSL_DEBUG_LEVEL 1 // Check that ScriptChangeInfos are in increasing order of // position and that we don't have empty changes. sal_uInt8 nLastTyp = i18n::ScriptType::WEAK; commit b7c30884e17027cdb71b05dea5971869b8dbea6c Author: Khaled Hosny khaledho...@eglug.org Date: Tue Jan 21 13:59:56 2014 +0200 It is just an innocent hyphen not a hyphenator Change-Id: I7454d90adfd507aae4c7efd1d4075454f03cddd8 diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index e2a4f38..dd93f55 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -6016,11 +6016,11 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString rStr, long nTextWidth, } sal_Int32 OutputDevice::GetTextBreak( const OUString rStr, long nTextWidth, - sal_Unicode nHyphenatorChar, sal_Int32 rHyphenatorPos, + sal_Unicode nHyphenChar, sal_Int32 rHyphenPos, sal_Int32 nIndex, sal_Int32 nLen, long nCharExtra ) const { -rHyphenatorPos = -1; +rHyphenPos = -1; SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen ); sal_Int32 nRetVal = -1; @@ -6046,24 +6046,24 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString rStr, long nTextWidth, nRetVal = pSalLayout-GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor ); // calculate hyphenated break position -OUString aHyphenatorStr(nHyphenatorChar); +OUString aHyphenStr(nHyphenChar); sal_Int32 nTempLen = 1; -SalLayout* pHyphenatorLayout = ImplLayout( aHyphenatorStr, 0, nTempLen ); -if( pHyphenatorLayout ) +SalLayout* pHyphenLayout = ImplLayout( aHyphenStr, 0, nTempLen ); +if( pHyphenLayout ) { // calculate subpixel width of hyphenation character -long nHyphenatorPixelWidth = pHyphenatorLayout-GetTextWidth() * nSubPixelFactor; -pHyphenatorLayout-Release(); +long nHyphenPixelWidth = pHyphenLayout-GetTextWidth() * nSubPixelFactor; +pHyphenLayout-Release(); // calculate hyphenated break position -nTextPixelWidth -= nHyphenatorPixelWidth; +nTextPixelWidth -= nHyphenPixelWidth; if( nExtraPixelWidth 0 ) nTextPixelWidth -= nExtraPixelWidth; -rHyphenatorPos = pSalLayout-GetTextBreak(nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor); +rHyphenPos