[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - 6 commits - cui/source include/sfx2 sd/source sfx2/source sw/source vcl/inc vcl/unx
Caolán McNamara
caolanm at redhat.com
Wed Jul 13 19:16:05 UTC 2016
cui/source/options/optpath.cxx | 19 +--
include/sfx2/sidebar/Sidebar.hxx | 12 ++
include/sfx2/sidebar/SidebarController.hxx | 16 +--
sd/source/ui/framework/tools/FrameworkHelper.cxx | 8 -
sd/source/ui/view/ViewShellImplementation.cxx | 2
sfx2/source/sidebar/Sidebar.cxx | 23 ++++
sfx2/source/sidebar/SidebarController.cxx | 19 +++
sfx2/source/view/viewfrm.cxx | 4
sw/source/core/layout/flowfrm.cxx | 3
sw/source/filter/ww8/docxattributeoutput.cxx | 16 +++
sw/source/filter/ww8/docxattributeoutput.hxx | 4
vcl/inc/unx/gtk/gtkframe.hxx | 2
vcl/unx/gtk/gtksalframe.cxx | 3
vcl/unx/gtk3/gtk3gtkframe.cxx | 112 ++++++++++++++---------
14 files changed, 172 insertions(+), 71 deletions(-)
New commits:
commit fbedd668d877d0c8194e5a80ac0336643e36064f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 5 10:16:51 2016 +0100
Resolves: rhbz#1352835 path options doesn't promptly destroy folder picker
(cherry picked from commit 3bbc0574d78d129359638b74612de2f93419eeb0)
Reviewed-on: https://gerrit.libreoffice.org/26942
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit bab5387447d2ea386b49367fe373b124a57c5ce6)
Change-Id: I5133f63fd92f384221fa2812c6e2a0e7f3b37ac1
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index b07ce78..a4122a9 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -635,11 +635,12 @@ IMPL_LINK_NOARG_TYPED(SvxPathTabPage, PathHdl_Impl, Button*, void)
else
{
short nRet = xFolderPicker->execute();
- if ( ExecutableDialogResults::OK != nRet )
- return;
-
- OUString sFolder( xFolderPicker->getDirectory() );
- ChangeCurrentEntry( sFolder );
+ if (nRet == ExecutableDialogResults::OK)
+ {
+ OUString sFolder(xFolderPicker->getDirectory());
+ ChangeCurrentEntry(sFolder);
+ }
+ xFolderPicker.clear();
}
}
catch( Exception& )
@@ -723,19 +724,17 @@ IMPL_LINK_TYPED( SvxPathTabPage, HeaderEndDrag_Impl, HeaderBar*, pBar, void )
}
}
-
IMPL_LINK_TYPED( SvxPathTabPage, DialogClosedHdl, DialogClosedEvent*, pEvt, void )
{
- if ( RET_OK == pEvt->DialogResult )
+ assert(xFolderPicker.is() && "SvxPathTabPage::DialogClosedHdl(): no folder picker");
+ if (RET_OK == pEvt->DialogResult)
{
- DBG_ASSERT( xFolderPicker.is(), "SvxPathTabPage::DialogClosedHdl(): no folder picker" );
-
OUString sURL = xFolderPicker->getDirectory();
ChangeCurrentEntry( sURL );
}
+ xFolderPicker.clear();
}
-
void SvxPathTabPage::GetPathList(
sal_uInt16 _nPathHandle, OUString& _rInternalPath,
OUString& _rUserPath, OUString& _rWritablePath, bool& _rReadOnly )
commit 6adddbfb6b0fd9e0348546114f9dd2d035c1be3f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 3 11:06:22 2016 +0100
Resolves: tdf#88396 switching to sidebar panel will toggle it *off*...
if its already visible.
This solves tdf#88396, but I did this fix originally for....
on switching to slide layouts panel move into slide layout context
i.e. exit current textbox edit and shape selection
(cherry picked from commit 05aaef55252bc9f90cbbcc1967c38ab9a5a6c798)
OpenThenSwitchToDeck actually *toggles* deck visibility
so rename it to that and add a OpenThenSwitchToDeck that actually
does that, using the Toggle varient as the callback from the
sidebar button which toggles the current deck on/off
which retains the features of
// tdf#67627 Clicking a second time on a Deck icon will close the Deck
// tdf#88241 Summoning an undocked sidebar a second time should close sidebar
but means that calls to OpenThenSwitchToDeck from e.g. slide layout
don't auto close it if that deck is already open
(cherry picked from commit b81daea4a78083def286fa2d5360b152b7a703fd)
3e3724626b93447a7ab6bc7032e9c6839dabcf55
Change-Id: I16a2fca158cb4caab7b6bd001742df698735dd2b
Reviewed-on: https://gerrit.libreoffice.org/27071
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit e1e61bf5e5f368fc1ea579f8ae5eec9faafbd599)
diff --git a/include/sfx2/sidebar/Sidebar.hxx b/include/sfx2/sidebar/Sidebar.hxx
index aea1fcb..6b138b9 100644
--- a/include/sfx2/sidebar/Sidebar.hxx
+++ b/include/sfx2/sidebar/Sidebar.hxx
@@ -38,7 +38,17 @@ public:
this function probably returns before the requested panel is visible.
*/
static void ShowPanel (
- const ::rtl::OUString& rsPanelId,
+ const OUString& rsPanelId,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ /** Switch to the deck that contains the specified panel and toggle
+ the visibility of the panel (expanded and scrolled into the
+ visible area when visible)
+ Note that most of the work is done asynchronously and that
+ this function probably returns before the requested panel is visible.
+ */
+ static void TogglePanel (
+ const OUString& rsPanelId,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
};
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index c077eeb..0298862 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -124,8 +124,8 @@ public:
const static sal_Int32 gnMaximumSidebarWidth = 400;
- void OpenThenSwitchToDeck (
- const ::rtl::OUString& rsDeckId);
+ void OpenThenSwitchToDeck(const OUString& rsDeckId);
+ void OpenThenToggleDeck(const OUString& rsDeckId);
/** Show only the tab bar, not the deck.
*/
@@ -137,7 +137,7 @@ public:
/** Returns true when the given deck is the currently visible deck
*/
- bool IsDeckVisible (const ::rtl::OUString& rsDeckId);
+ bool IsDeckVisible(const OUString& rsDeckId);
FocusManager& GetFocusManager() { return maFocusManager;}
@@ -148,14 +148,14 @@ public:
Context GetCurrentContext() const { return maCurrentContext;}
bool IsDocumentReadOnly (void) const { return mbIsDocumentReadOnly;}
- void SwitchToDeck ( const ::rtl::OUString& rsDeckId);
+ void SwitchToDeck(const OUString& rsDeckId);
void SwitchToDefaultDeck();
void CreateDeck(const ::rtl::OUString& rDeckId, bool bForceCreate = false);
void CreatePanels(const ::rtl::OUString& rDeckId);
ResourceManager::DeckContextDescriptorContainer GetMatchingDecks();
- ResourceManager::PanelContextDescriptorContainer GetMatchingPanels( const ::rtl::OUString& rDeckId);
+ ResourceManager::PanelContextDescriptorContainer GetMatchingPanels(const OUString& rDeckId);
void notifyDeckTitle(const OUString& targetDeckId);
@@ -174,7 +174,7 @@ private:
css::uno::Reference<css::frame::XController> mxCurrentController;
/// Use a combination of SwitchFlag_* as value.
sal_Int32 mnRequestedForceFlags;
- ::rtl::OUString msCurrentDeckId;
+ OUString msCurrentDeckId;
AsynchronousCall maPropertyChangeForwarder;
AsynchronousCall maContextChangeUpdate;
AsynchronousCall maAsynchronousDeckSwitch;
@@ -216,12 +216,12 @@ private:
css::uno::Reference<css::ui::XUIElement> CreateUIElement (
const css::uno::Reference<css::awt::XWindowPeer>& rxWindow,
- const ::rtl::OUString& rsImplementationURL,
+ const OUString& rsImplementationURL,
const bool bWantsCanvas,
const Context& rContext);
VclPtr<Panel> CreatePanel (
- const ::rtl::OUString& rsPanelId,
+ const OUString& rsPanelId,
vcl::Window* pParentWindow,
const bool bIsInitiallyExpanded,
const Context& rContext,
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx
index b523e03..7944304 100644
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -120,6 +120,8 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
if (!pArgs || pArgs->Count() == 1 || pArgs->Count() == 2 )
{
// First make sure that the sidebar is visible
+ mrViewShell.GetDrawView()->SdrEndTextEdit();
+ mrViewShell.GetDrawView()->UnmarkAll();
mrViewShell.GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
sfx2::sidebar::Sidebar::ShowPanel(
"SdLayoutsPanel",
diff --git a/sfx2/source/sidebar/Sidebar.cxx b/sfx2/source/sidebar/Sidebar.cxx
index c4e9c80..02a17f4 100644
--- a/sfx2/source/sidebar/Sidebar.cxx
+++ b/sfx2/source/sidebar/Sidebar.cxx
@@ -45,6 +45,29 @@ void Sidebar::ShowPanel (
}
}
+void Sidebar::TogglePanel (
+ const ::rtl::OUString& rsPanelId,
+ const css::uno::Reference<frame::XFrame>& rxFrame)
+{
+ SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
+
+ if (!pController)
+ return;
+
+ std::shared_ptr<PanelDescriptor> xPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId);
+
+ if (!xPanelDescriptor)
+ return;
+
+ // This should be a lot more sophisticated:
+ // - Make the deck switching asynchronous
+ // - Make sure to use a context that really shows the panel
+
+ // All that is not necessary for the current use cases so lets
+ // keep it simple for the time being.
+ pController->OpenThenToggleDeck(xPanelDescriptor->msDeckId);
+}
+
} } // end of namespace sfx2::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 74973d1..fe73d2c 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -94,7 +94,7 @@ SidebarController::SidebarController (
mpTabBar(VclPtr<TabBar>::Create(
mpParentWindow,
rxFrame,
- [this](const ::rtl::OUString& rsDeckId) { return this->OpenThenSwitchToDeck(rsDeckId); },
+ [this](const ::rtl::OUString& rsDeckId) { return this->OpenThenToggleDeck(rsDeckId); },
[this](const Rectangle& rButtonBox,const ::std::vector<TabBar::DeckMenuData>& rMenuData) { return this->ShowPopupMenu(rButtonBox,rMenuData); },
this)),
mxFrame(rxFrame),
@@ -500,8 +500,8 @@ void SidebarController::UpdateConfigurations()
}
}
-void SidebarController::OpenThenSwitchToDeck (
- const ::rtl::OUString& rsDeckId)
+void SidebarController::OpenThenToggleDeck (
+ const OUString& rsDeckId)
{
SfxSplitWindow* pSplitWindow = GetSplitWindow();
if ( pSplitWindow && !pSplitWindow->IsFadeIn() )
@@ -523,6 +523,19 @@ void SidebarController::OpenThenSwitchToDeck (
mpTabBar->HighlightDeck(rsDeckId);
}
+void SidebarController::OpenThenSwitchToDeck (
+ const OUString& rsDeckId)
+{
+ SfxSplitWindow* pSplitWindow = GetSplitWindow();
+ if ( pSplitWindow && !pSplitWindow->IsFadeIn() )
+ // tdf#83546 Collapsed sidebar should expand first
+ pSplitWindow->FadeIn();
+ RequestOpenDeck();
+ SwitchToDeck(rsDeckId);
+ mpTabBar->Invalidate();
+ mpTabBar->HighlightDeck(rsDeckId);
+}
+
void SidebarController::SwitchToDefaultDeck()
{
SwitchToDeck(gsDefaultDeckId);
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index c6e5726..9904eaa 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3056,8 +3056,8 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq )
// First make sure that the sidebar is visible
ShowChildWindow(SID_SIDEBAR);
- ::sfx2::sidebar::Sidebar::ShowPanel("StyleListPanel",
- GetFrame().GetFrameInterface());
+ ::sfx2::sidebar::Sidebar::TogglePanel("StyleListPanel",
+ GetFrame().GetFrameInterface());
rReq.Done();
return;
}
commit 1a90ab3feb9cf3c92e9b142778d4c88acbad1f21
Author: Justin Luth <justin_luth at sil.org>
Date: Mon Jul 11 18:07:32 2016 +0300
tdf#99090 docx export page-break only inside a paragraph
If a paragraph hadn't been started yet, a w:r was being written directly in
the /document/body which caused MSWord to complain about a corrupt document.
Reviewed-on: https://gerrit.libreoffice.org/26771
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
(cherry picked from commit 07fb94655f4745eb4e80bf6e8d4cdd95371f23bb)
Change-Id: Ie7f629869aab0f3d2405660a033c3f23bbd6baca
Reviewed-on: https://gerrit.libreoffice.org/27121
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit 28ded9c98837d6b6eefff73f396353b61b6b4017)
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f188588..c59931b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1065,6 +1065,16 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar
m_nColBreakStatus = COLBRK_NONE;
}
+ if ( m_bPostponedPageBreak )
+ {
+ m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
+ m_pSerializer->singleElementNS( XML_w, XML_br,
+ FSNS( XML_w, XML_type ), "page", FSEND );
+ m_pSerializer->endElementNS( XML_w, XML_r );
+
+ m_bPostponedPageBreak = false;
+ }
+
// merge the properties _before_ the run (strictly speaking, just
// after the start of the paragraph)
m_pSerializer->mergeTopMarks(Tag_StartParagraphProperties, sax_fastparser::MergeMarks::PREPEND);
@@ -5414,13 +5424,16 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectio
m_pSectionInfo.reset( new WW8_SepInfo( *pSectionInfo ));
}
}
- else
+ else if ( m_bParagraphOpened )
{
m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
m_pSerializer->singleElementNS( XML_w, XML_br,
FSNS( XML_w, XML_type ), "page", FSEND );
m_pSerializer->endElementNS( XML_w, XML_r );
}
+ else
+ m_bPostponedPageBreak = true;
+
break;
default:
OSL_TRACE( "Unknown section break to write: %d", nC );
@@ -8465,6 +8478,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_bAlternateContentChoiceOpen( false ),
m_bPostponedProcessingFly( false ),
m_nColBreakStatus( COLBRK_NONE ),
+ m_bPostponedPageBreak( false ),
m_nTextFrameLevel( 0 ),
m_closeHyperlinkInThisRun( false ),
m_closeHyperlinkInPreviousRun( false ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 4089d29..0b2d4ad 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -810,6 +810,10 @@ private:
// beginning of the next paragraph
DocxColBreakStatus m_nColBreakStatus;
+ // Remember that a page break has to be opened at the
+ // beginning of the next paragraph
+ bool m_bPostponedPageBreak;
+
std::vector<ww8::Frame> m_aFramesOfParagraph;
sal_Int32 m_nTextFrameLevel;
commit 6643c015abc586c914335af468a7d725b896360c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jun 23 17:32:11 2016 +0100
Resolves: rhbz#1349501 gtk3: smooth scrolling events can be disabled...
by the user with GDK_CORE_DEVICE_EVENTS=1, and so manage to disable their wheel
scrolling
(cherry picked from commit 7dfd50f947671d79b9119f10259857700d5728d8)
Change-Id: I7df63f738983c90dea75b9f43a36133910446aba
Resolves: rhbz#1349501 gtk3: smooth scrolling events can be disabled...
better fix, if we listen to the eventbox we get either SMOOTH scrolling
or not smooth events, not both. We get SMOOTH when supported, and not
if not supported so no need to reintroduce the miserable hack, which
doesn't work under wayland anyway
Change-Id: I993e71d3553322425a506cd93d812efe081bf3c9
(cherry picked from commit 053a843bccaef2d2323be3ddff6217c592a4c5db)
Reviewed-on: https://gerrit.libreoffice.org/26646
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit bda6bce91555861f604a74b8f3d6cc6cd35c11c4)
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index eaa222f..3b81c54 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -277,7 +277,7 @@ class GtkSalFrame : public SalFrame
static gboolean signalKey( GtkWidget*, GdkEventKey*, gpointer );
static gboolean signalDelete( GtkWidget*, GdkEvent*, gpointer );
static gboolean signalWindowState( GtkWidget*, GdkEvent*, gpointer );
- static gboolean signalScroll( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalScroll( GtkWidget*, GdkEventScroll* pEvent, gpointer );
static gboolean signalCrossing( GtkWidget*, GdkEventCrossing*, gpointer );
static gboolean signalVisibility( GtkWidget*, GdkEventVisibility*, gpointer );
static void signalDestroy( GtkWidget*, gpointer );
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 95fd581..84615c8 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -2855,10 +2855,9 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
return true;
}
-gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame )
+gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEventScroll* pSEvent, gpointer frame )
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- GdkEventScroll* pSEvent = reinterpret_cast<GdkEventScroll*>(pEvent);
static sal_uLong nLines = 0;
if( ! nLines )
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 6363815..1c57991 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1039,6 +1039,7 @@ void GtkSalFrame::InitCommon()
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "drag-failed", G_CALLBACK(signalDragFailed), this ));
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "drag-data-delete", G_CALLBACK(signalDragDelete), this ));
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "drag-data-get", G_CALLBACK(signalDragDataGet), this ));
+ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "scroll-event", G_CALLBACK(signalScroll), this ));
g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this );
g_signal_connect( G_OBJECT(m_pFixedContainer), "size-allocate", G_CALLBACK(sizeAllocated), this );
@@ -1064,7 +1065,6 @@ void GtkSalFrame::InitCommon()
g_signal_connect( G_OBJECT(m_pWindow), "key-release-event", G_CALLBACK(signalKey), this );
g_signal_connect( G_OBJECT(m_pWindow), "delete-event", G_CALLBACK(signalDelete), this );
g_signal_connect( G_OBJECT(m_pWindow), "window-state-event", G_CALLBACK(signalWindowState), this );
- g_signal_connect( G_OBJECT(m_pWindow), "scroll-event", G_CALLBACK(signalScroll), this );
g_signal_connect( G_OBJECT(m_pWindow), "leave-notify-event", G_CALLBACK(signalCrossing), this );
g_signal_connect( G_OBJECT(m_pWindow), "enter-notify-event", G_CALLBACK(signalCrossing), this );
g_signal_connect( G_OBJECT(m_pWindow), "visibility-notify-event", G_CALLBACK(signalVisibility), this );
@@ -2559,54 +2559,88 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
return true;
}
-gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame )
+gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEventScroll* pEvent, gpointer frame )
{
- GdkEventScroll* pSEvent = reinterpret_cast<GdkEventScroll*>(pEvent);
- if (pSEvent->direction != GDK_SCROLL_SMOOTH)
- return false;
-
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
SalWheelMouseEvent aEvent;
- aEvent.mnTime = pSEvent->time;
- aEvent.mnX = (sal_uLong)pSEvent->x;
+ aEvent.mnTime = pEvent->time;
+ aEvent.mnX = (sal_uLong)pEvent->x;
// --- RTL --- (mirror mouse pos)
if (AllSettings::GetLayoutRTL())
aEvent.mnX = pThis->maGeometry.nWidth - 1 - aEvent.mnX;
- aEvent.mnY = (sal_uLong)pSEvent->y;
- aEvent.mnCode = GetMouseModCode( pSEvent->state );
-
- // rhbz#1344042 "Traditionally" in gtk3 we tool a single up/down event as
- // equating to 3 scroll lines and a delta of 120. So scale the delta here
- // by 120 where a single mouse wheel click is an incoming delta_x of 1
- // and divide that by 40 to get the number of scrollines
- if (pSEvent->delta_x != 0.0)
- {
- aEvent.mnDelta = -pSEvent->delta_x * 120;
- aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : +1;
- if (aEvent.mnDelta == 0)
- aEvent.mnDelta = aEvent.mnNotchDelta;
- aEvent.mbHorz = true;
- aEvent.mnScrollLines = std::abs(aEvent.mnDelta) / 40;
- if (aEvent.mnScrollLines == 0)
- aEvent.mnScrollLines = 1;
-
- pThis->CallCallback(SALEVENT_WHEELMOUSE, &aEvent);
- }
+ aEvent.mnY = (sal_uLong)pEvent->y;
+ aEvent.mnCode = GetMouseModCode( pEvent->state );
- if (pSEvent->delta_y != 0.0)
+ switch (pEvent->direction)
{
- aEvent.mnDelta = -pSEvent->delta_y * 120;
- aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : +1;
- if (aEvent.mnDelta == 0)
- aEvent.mnDelta = aEvent.mnNotchDelta;
- aEvent.mbHorz = false;
- aEvent.mnScrollLines = std::abs(aEvent.mnDelta) / 40;
- if (aEvent.mnScrollLines == 0)
- aEvent.mnScrollLines = 1;
-
- pThis->CallCallback(SALEVENT_WHEELMOUSE, &aEvent);
+ case GDK_SCROLL_SMOOTH:
+ // rhbz#1344042 "Traditionally" in gtk3 we tool a single up/down event as
+ // equating to 3 scroll lines and a delta of 120. So scale the delta here
+ // by 120 where a single mouse wheel click is an incoming delta_x of 1
+ // and divide that by 40 to get the number of scrollines
+ if (pEvent->delta_x != 0.0)
+ {
+ aEvent.mnDelta = -pEvent->delta_x * 120;
+ aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : +1;
+ if (aEvent.mnDelta == 0)
+ aEvent.mnDelta = aEvent.mnNotchDelta;
+ aEvent.mbHorz = true;
+ aEvent.mnScrollLines = std::abs(aEvent.mnDelta) / 40;
+ if (aEvent.mnScrollLines == 0)
+ aEvent.mnScrollLines = 1;
+
+ pThis->CallCallback(SALEVENT_WHEELMOUSE, &aEvent);
+ }
+
+ if (pEvent->delta_y != 0.0)
+ {
+ aEvent.mnDelta = -pEvent->delta_y * 120;
+ aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : +1;
+ if (aEvent.mnDelta == 0)
+ aEvent.mnDelta = aEvent.mnNotchDelta;
+ aEvent.mbHorz = false;
+ aEvent.mnScrollLines = std::abs(aEvent.mnDelta) / 40;
+ if (aEvent.mnScrollLines == 0)
+ aEvent.mnScrollLines = 1;
+
+ pThis->CallCallback(SALEVENT_WHEELMOUSE, &aEvent);
+ }
+
+ break;
+
+ case GDK_SCROLL_UP:
+ aEvent.mnDelta = 120;
+ aEvent.mnNotchDelta = 1;
+ aEvent.mnScrollLines = 3;
+ aEvent.mbHorz = false;
+ pThis->CallCallback(SALEVENT_WHEELMOUSE, &aEvent);
+ break;
+
+ case GDK_SCROLL_DOWN:
+ aEvent.mnDelta = -120;
+ aEvent.mnNotchDelta = -1;
+ aEvent.mnScrollLines = 3;
+ aEvent.mbHorz = false;
+ pThis->CallCallback(SALEVENT_WHEELMOUSE, &aEvent);
+ break;
+
+ case GDK_SCROLL_LEFT:
+ aEvent.mnDelta = 120;
+ aEvent.mnNotchDelta = 1;
+ aEvent.mnScrollLines = 3;
+ aEvent.mbHorz = true;
+ pThis->CallCallback(SALEVENT_WHEELMOUSE, &aEvent);
+ break;
+
+ case GDK_SCROLL_RIGHT:
+ aEvent.mnDelta = -120;
+ aEvent.mnNotchDelta = -1;
+ aEvent.mnScrollLines = 3;
+ aEvent.mbHorz = true;
+ pThis->CallCallback(SALEVENT_WHEELMOUSE, &aEvent);
+ break;
}
return true;
commit cd8c14c729e5a48f8abb2162e697290813621082
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jul 8 16:09:36 2016 +0100
Resolves: tdf#100813 crash during pagination of particular docx
Change-Id: Id2c99cc6c5fe4c3a5bcf3c0b3f16b603cdd46239
(cherry picked from commit f374e01af32c7752b31455642e7d76f2056a2aeb)
Reviewed-on: https://gerrit.libreoffice.org/27051
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit f2dcce9155ddd9444f65b26c59c3b873ac603091)
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index e148afe..e823a83 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2013,6 +2013,9 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat )
}
SwFootnoteBossFrame * pOldBoss = m_rThis.FindFootnoteBossFrame();
+ if (!pOldBoss)
+ return false;
+
SwPageFrame * const pOldPage = pOldBoss->FindPageFrame();
SwLayoutFrame *pNewUpper = nullptr;
bool bCheckPageDescs = false;
commit 51f5b66cdfa7ea52f7e8d6c97bfd454d67f0f2fe
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Jul 11 14:04:18 2016 +0200
loplugin:staticcall
Change-Id: I800eef0517f063ff7e08a95de9da268fb0e9d621
Signed-off-by: Michael Meeks <michael.meeks at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/27160
(cherry picked from commit a405a164357d86630d8fbd0386e07f53c5b6c9a1)
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index ed74b7e..7a959a5 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -521,12 +521,12 @@ OUString FrameworkHelper::GetViewURL (ViewShell::ShellType eType)
namespace
{
-void updateEditMode(const Reference<XView> &xView, FrameworkHelper* const pHelper, const EditMode eEMode, bool updateFrameView)
+void updateEditMode(const Reference<XView> &xView, const EditMode eEMode, bool updateFrameView)
{
// Ensure we have the expected edit mode
// The check is only for DrawViewShell as OutlineViewShell
// and SlideSorterViewShell have no master mode
- const ::std::shared_ptr<ViewShell> pCenterViewShell (pHelper->GetViewShell(xView));
+ const ::std::shared_ptr<ViewShell> pCenterViewShell (FrameworkHelper::GetViewShell(xView));
DrawViewShell* pDrawViewShell
= dynamic_cast<DrawViewShell*>(pCenterViewShell.get());
if (pDrawViewShell != nullptr)
@@ -548,7 +548,7 @@ void asyncUpdateEditMode(FrameworkHelper* const pHelper, const EditMode eEMode)
Reference<XResourceId> xPaneId (
FrameworkHelper::CreateResourceId(framework::FrameworkHelper::msCenterPaneURL));
Reference<XView> xView (pHelper->GetView(xPaneId));
- updateEditMode(xView, pHelper, eEMode, true);
+ updateEditMode(xView, eEMode, true);
}
}
@@ -637,7 +637,7 @@ void FrameworkHelper::HandleModeChangeSlot (
}
else
{
- updateEditMode(xView, this, eEMode, false);
+ updateEditMode(xView, eEMode, false);
}
}
catch (RuntimeException&)
More information about the Libreoffice-commits
mailing list