[Libreoffice-commits] core.git: 2 commits - libreofficekit/source sw/source
László Németh
laszlo.nemeth at collabora.com
Fri Nov 6 10:33:45 PST 2015
libreofficekit/source/gtk/lokdocview.cxx | 23 +++++++++++-
sw/source/core/objectpositioning/anchoredobjectposition.cxx | 6 ++-
2 files changed, 26 insertions(+), 3 deletions(-)
New commits:
commit 16331514fd10d444bec89f892a106cbbba9e16c0
Author: László Németh <laszlo.nemeth at collabora.com>
Date: Fri Nov 6 14:54:02 2015 +0100
tdf#92648 fix DOCX import regression (textbox shrinking in footers)
caused by the fix for tdf#91260
Change-Id: I4a5a27b51c4cb1304647b5432c06ca9c5a96590d
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 1993919..a824989 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -484,8 +484,10 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
SwFrameFormat* pFrameFormat = ::FindFrameFormat(&GetObject());
SwFormatFrmSize aSize(pFormat->GetFrmSize());
SwTwips nShrinked = aSize.GetHeight() - (nProposedRelPosY - nAdjustedRelPosY);
- aSize.SetHeight( nShrinked > 0 ? nShrinked : 0 );
- pFrameFormat->SetFormatAttr(aSize);
+ if (nShrinked >= 0) {
+ aSize.SetHeight( nShrinked );
+ pFrameFormat->SetFormatAttr(aSize);
+ }
nAdjustedRelPosY = nProposedRelPosY;
} else if ( SwTextBoxHelper::findTextBox(pFormat) )
// when the shape has a textbox, use only the proposed vertical position
commit 63d2d50ecb3f3a83374a1a01713edce14ba378ed
Author: László Németh <laszlo.nemeth at collabora.com>
Date: Fri Nov 6 19:26:29 2015 +0100
gtktiledviewer: add Ctrl, Alt, Shift shortcut support
For example in Writer:
Ctrl-B for bold text
Ctrl-Shift-B/P for subscript/superscript
Ctrl-Alt-C insert comment
Ctrl-1 apply Heading 1 paragraph style
Change-Id: Iaeb8341f2cb273980b637ff2fed89585094e0d9d
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 9aaa5ef..475f388 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -337,7 +337,7 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent)
return FALSE;
}
- priv->m_nKeyModifier = 0;
+ priv->m_nKeyModifier &= KEY_MOD2;
switch (pEvent->keyval)
{
case GDK_KEY_BackSpace:
@@ -381,6 +381,8 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent)
case GDK_KEY_Alt_R:
if (pEvent->type == GDK_KEY_PRESS)
priv->m_nKeyModifier |= KEY_MOD2;
+ else
+ priv->m_nKeyModifier &= ~KEY_MOD2;
break;
default:
if (pEvent->keyval >= GDK_KEY_F1 && pEvent->keyval <= GDK_KEY_F26)
@@ -395,6 +397,25 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent)
if (pEvent->state & GDK_SHIFT_MASK)
nKeyCode |= KEY_SHIFT;
+ if (pEvent->state & GDK_CONTROL_MASK)
+ nKeyCode |= KEY_MOD1;
+
+ if (priv->m_nKeyModifier & KEY_MOD2)
+ nKeyCode |= KEY_MOD2;
+
+ if (nKeyCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)) {
+ if (pEvent->keyval >= GDK_KEY_a && pEvent->keyval <= GDK_KEY_z)
+ {
+ nKeyCode |= 512 + (pEvent->keyval - GDK_KEY_a);
+ }
+ else if (pEvent->keyval >= GDK_KEY_A && pEvent->keyval <= GDK_KEY_Z) {
+ nKeyCode |= 512 + (pEvent->keyval - GDK_KEY_A);
+ }
+ else if (pEvent->keyval >= GDK_KEY_0 && pEvent->keyval <= GDK_KEY_9) {
+ nKeyCode |= 256 + (pEvent->keyval - GDK_KEY_0);
+ }
+ }
+
if (pEvent->type == GDK_KEY_RELEASE)
{
GTask* task = g_task_new(pDocView, NULL, NULL, NULL);
More information about the Libreoffice-commits
mailing list