Rebased ref, commits from common ancestor: commit b1b1d4d1436a10d30238be4c21396e7becbd35c3 Author: Pranav Kant <pran...@gnome.org> Date: Wed Jun 24 02:02:39 2015 +0530
lokdocview: Handle DELETE key Change-Id: I58d0c36decf81c812c108458b449402416ebcc2d diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index ca7167b..62f1e61 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -245,6 +245,9 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent) case GDK_KEY_BackSpace: nKeyCode = com::sun::star::awt::Key::BACKSPACE; break; + case GDK_KEY_Delete: + nKeyCode = com::sun::star::awt::Key::DELETE; + break; case GDK_KEY_Return: nKeyCode = com::sun::star::awt::Key::RETURN; break; commit 36f579009678a31ebc34d2fb131bfd96060d3035 Author: Pranav Kant <pran...@gnome.org> Date: Tue Jun 23 14:37:09 2015 +0530 tilebuffer: Add timer to measure paintTile() call Change-Id: I2645863c7445e17d77e2c4e2dc24e22f8685034e diff --git a/libreofficekit/source/gtk/tilebuffer.cxx b/libreofficekit/source/gtk/tilebuffer.cxx index 3f22f98..60aa16f 100644 --- a/libreofficekit/source/gtk/tilebuffer.cxx +++ b/libreofficekit/source/gtk/tilebuffer.cxx @@ -91,7 +91,7 @@ Tile& TileBuffer::getTile(int x, int y, float aZoom) aTileRectangle.x = pixelToTwip(nTileSizePixels, aZoom) * y; aTileRectangle.y = pixelToTwip(nTileSizePixels, aZoom) * x; - g_info ("Rendering (%d, %d)", x, y); + g_test_timer_start(); m_pLOKDocument->pClass->paintTile(m_pLOKDocument, pBuffer, nTileSizePixels, nTileSizePixels, @@ -99,6 +99,9 @@ Tile& TileBuffer::getTile(int x, int y, float aZoom) pixelToTwip(nTileSizePixels, aZoom), pixelToTwip(nTileSizePixels, aZoom)); + double elapsedTime = g_test_timer_elapsed(); + g_info ("Rendered (%d, %d) in %f seconds", x, y, elapsedTime); + //create a mapping for it m_mTiles[index].setPixbuf(pPixBuf); m_mTiles[index].valid = true; commit 133289917ff62df014693e308bf3b105cdb74d6f Author: Pranav Kant <pran...@gnome.org> Date: Tue Jun 23 02:58:38 2015 +0530 lokdocview: Remove superfluous *_post_key() Instead directly let LOKDocView handle the input. Change-Id: I260a460df23c3e2e5c78d8b363bb864ae5c63dab diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h index 3a1628b..962f9d9 100644 --- a/include/LibreOfficeKit/LibreOfficeKitGtk.h +++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h @@ -74,10 +74,6 @@ void lok_doc_view_post_command (LOKDocView* const char* pCommand, const char* pArguments); -/// Posts a keyboard event to LibreOfficeKit. -void lok_doc_view_post_key (LOKDocView* pDocView, - GdkEvent* pEvent); - float lok_doc_view_pixel_to_twip (LOKDocView* pDocView, float fInput); diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index c854288..18815d6 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -191,19 +191,6 @@ static void getVisibleAreaTwips(GdkRectangle* pArea) #endif } - -/// Handles the key-press-event of the window. -static gboolean signalKey(GtkWidget* /*pWidget*/, GdkEvent* pEvent, gpointer/* pData*/) -{ - LOKDocView* pLOKDocView = LOK_DOC_VIEW(pDocView); - if (!gtk_widget_get_visible(pFindbar) && bool(lok_doc_view_get_edit(pLOKDocView))) - { - lok_doc_view_post_key(pLOKDocView, pEvent); - return TRUE; - } - return FALSE; -} - /// Searches for the next or previous text of pFindbarEntry. static void doSearch(bool bBackwards) { @@ -541,10 +528,6 @@ int main( int argc, char* argv[] ) g_signal_connect(pDocView, "part-changed", G_CALLBACK(signalPart), NULL); g_signal_connect(pDocView, "hyperlink-clicked", G_CALLBACK(signalHyperlink), NULL); - // Input handling. - g_signal_connect(pWindow, "key-press-event", G_CALLBACK(signalKey), pDocView); - g_signal_connect(pWindow, "key-release-event", G_CALLBACK(signalKey), pDocView); - // Scrolled window for DocView pScrolledWindow = gtk_scrolled_window_new(0, 0); gtk_widget_set_hexpand (pScrolledWindow, TRUE); @@ -568,6 +551,11 @@ int main( int argc, char* argv[] ) g_signal_connect(G_OBJECT(pPartModeComboBox), "changed", G_CALLBACK(changePartMode), 0); g_signal_connect(G_OBJECT(pPartSelector), "changed", G_CALLBACK(changePart), 0); + // Make only LOKDocView widget as focussable + GList *focusChain = NULL; + focusChain = g_list_append( focusChain, pDocView ); + gtk_container_set_focus_chain ( GTK_CONTAINER (pVBox), focusChain ); + gtk_main(); return 0; diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 988397a..ca7167b 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -226,24 +226,21 @@ isEmptyRectangle(const GdkRectangle& rRectangle) return rRectangle.x == 0 && rRectangle.y == 0 && rRectangle.width == 0 && rRectangle.height == 0; } -static void -signalKey (LOKDocView* pDocView, const GdkEvent* pEvent) +static gboolean +signalKey (GtkWidget* pWidget, GdkEventKey* pEvent) { + LOKDocView* pDocView = LOK_DOC_VIEW(pWidget); LOKDocViewPrivate* priv = static_cast<LOKDocViewPrivate*>(lok_doc_view_get_instance_private (pDocView)); int nCharCode = 0; int nKeyCode = 0; - guint keyval; - GdkModifierType state; - gdk_event_get_keyval (pEvent, &keyval); - gdk_event_get_state (pEvent, &state); if (!priv->m_bEdit) { g_info("signalKey: not in edit mode, ignore"); - return; + return FALSE; } - switch (keyval) + switch (pEvent->keyval) { case GDK_KEY_BackSpace: nKeyCode = com::sun::star::awt::Key::BACKSPACE; @@ -270,22 +267,24 @@ signalKey (LOKDocView* pDocView, const GdkEvent* pEvent) nKeyCode = com::sun::star::awt::Key::RIGHT; break; default: - if (keyval >= GDK_KEY_F1 && keyval <= GDK_KEY_F26) - nKeyCode = com::sun::star::awt::Key::F1 + (keyval - GDK_KEY_F1); + if (pEvent->keyval >= GDK_KEY_F1 && pEvent->keyval <= GDK_KEY_F26) + nKeyCode = com::sun::star::awt::Key::F1 + (pEvent->keyval - GDK_KEY_F1); else - nCharCode = gdk_keyval_to_unicode(keyval); + nCharCode = gdk_keyval_to_unicode(pEvent->keyval); } // rsc is not public API, but should be good enough for debugging purposes. // If this is needed for real, then probably a new param of type // css::awt::KeyModifier is needed in postKeyEvent(). - if (state & GDK_SHIFT_MASK) + if (pEvent->state & GDK_SHIFT_MASK) nKeyCode |= KEY_SHIFT; if (pEvent->type == GDK_KEY_RELEASE) priv->m_pDocument->pClass->postKeyEvent(priv->m_pDocument, LOK_KEYEVENT_KEYUP, nCharCode, nKeyCode); else priv->m_pDocument->pClass->postKeyEvent(priv->m_pDocument, LOK_KEYEVENT_KEYINPUT, nCharCode, nKeyCode); + + return FALSE; } static gboolean @@ -1151,6 +1150,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) pWidgetClass->draw = lok_doc_view_draw; pWidgetClass->button_press_event = lok_doc_view_signal_button; pWidgetClass->button_release_event = lok_doc_view_signal_button; + pWidgetClass->key_press_event = signalKey; + pWidgetClass->key_release_event = signalKey; pWidgetClass->motion_notify_event = lok_doc_view_signal_motion; /** @@ -1431,6 +1432,8 @@ lok_doc_view_open_document (LOKDocView* pDocView, const gchar* pPath) gtk_widget_set_size_request(GTK_WIDGET(pDocView), nDocumentWidthPixels, nDocumentHeightPixels); + gtk_widget_set_can_focus(GTK_WIDGET(pDocView), TRUE); + gtk_widget_grab_focus(GTK_WIDGET(pDocView)); } return TRUE; } @@ -1579,19 +1582,6 @@ lok_doc_view_post_command (LOKDocView* pDocView, } /** - * lok_doc_view_post_key: - * @pDocView: the #LOKDocView instance - * @pEvent: the #GdkEventKey containing information about the event - * - * This methods forwards your key events to the LO core. -*/ -SAL_DLLPUBLIC_EXPORT void -lok_doc_view_post_key (LOKDocView* pDocView, GdkEvent* pEvent) -{ - signalKey(pDocView, pEvent); -} - -/** * lok_doc_view_pixel_to_twip: * @pDocView: The #LOKDocView instance * @fInput: The value in pixels to convert to twips commit 1450f6b1d662dbbb335e917c221f544b76ea6b4d Author: Pranav Kant <pran...@gnome.org> Date: Tue Jun 23 01:52:44 2015 +0530 lokdocview: Don't handle hyperlink clicks Instead emit the signal 'hyperlink-clicked', and let the application decide how it wants to handle the hyperlink clicks. Change-Id: Ief72bbd16727e140cacf28b852ad43952c02f7ae diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index a583323..c854288 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -311,6 +311,17 @@ static void signalPart(LOKDocView* /*pLOKDocView*/, int nPart, gpointer /*pData* g_bPartSelectorBroadcast = true; } +static void signalHyperlink(LOKDocView* /*pLOKDocView*/, char* pPayload, gpointer /*pData*/) +{ + GError* pError = NULL; + gtk_show_uri(NULL, pPayload, GDK_CURRENT_TIME, &pError); + if (pError != NULL) + { + g_warning("Unable to show URI %s : %s", pPayload, pError->message); + g_error_free(pError); + } +} + /// User clicked on a cmmand button -> inform LOKDocView. static void toggleToolItem(GtkWidget* pWidget, gpointer /*pData*/) { @@ -528,6 +539,7 @@ int main( int argc, char* argv[] ) g_signal_connect(pDocView, "command-changed", G_CALLBACK(signalCommand), NULL); g_signal_connect(pDocView, "search-not-found", G_CALLBACK(signalSearch), NULL); g_signal_connect(pDocView, "part-changed", G_CALLBACK(signalPart), NULL); + g_signal_connect(pDocView, "hyperlink-clicked", G_CALLBACK(signalHyperlink), NULL); // Input handling. g_signal_connect(pWindow, "key-press-event", G_CALLBACK(signalKey), pDocView); diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index cff02ea..988397a 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -324,6 +324,12 @@ setPart(LOKDocView* pDocView, const std::string& rString) g_signal_emit(pDocView, doc_view_signals[PART_CHANGED], 0, std::stoi(rString)); } +static void +hyperlinkClicked(LOKDocView* pDocView, const std::string& rString) +{ + g_signal_emit(pDocView, doc_view_signals[HYPERLINK_CLICKED], 0, rString.c_str()); +} + /// Implementation of the global callback handler, invoked by globalCallback(); static gboolean globalCallback (gpointer pData) @@ -507,8 +513,7 @@ callback (gpointer pData) break; case LOK_CALLBACK_HYPERLINK_CLICKED: { - GError* pError = NULL; - gtk_show_uri(NULL, pCallback->m_aPayload.c_str(), GDK_CURRENT_TIME, &pError); + hyperlinkClicked(pDocView, pCallback->m_aPayload); } break; case LOK_CALLBACK_STATE_CHANGED: @@ -1353,7 +1358,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) * @aHyperlink: the URI which the application should handle */ doc_view_signals[HYPERLINK_CLICKED] = - g_signal_new("hyperlinked-clicked", + g_signal_new("hyperlink-clicked", G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, commit 54106fae68149c0b1dbb4f6ece133fefacacc322 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 17:38:24 2015 +0200 SwTextFormatInfo::SwTextFormatInfo: use vcl::RenderContext Change-Id: I8ff1647bdf8c46d395c398c97b97066d7b128cdb diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 79cf3f3..c42f059 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -491,7 +491,7 @@ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > SwTextFrm::Get com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > tabs(1); ::com::sun::star::style::TabStop ts; - SwTextFormatInfo aInf( this ); + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this ); SwTextFormatter aLine( this, &aInf ); SwTextCursor TextCursor( this, &aInf ); const Point aCharPos( TextCursor.GetTopLeft() ); @@ -855,7 +855,7 @@ bool SwTextFrm::CalcPreps() { SWAP_IF_NOT_SWAPPED swap( this ); - SwTextFormatInfo aInf( this ); + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this ); SwTextFormatter aLine( this, &aInf ); WidowsAndOrphans aFrmBreak( this ); @@ -1650,7 +1650,7 @@ void SwTextFrm::_Format( SwParaPortion *pPara ) if ( IsVertical() ) SwapWidthAndHeight(); - SwTextFormatInfo aInf( this ); + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this ); SwTextFormatter aLine( this, &aInf ); HideAndShowObjects(); @@ -1877,7 +1877,7 @@ bool SwTextFrm::FormatQuick( bool bForceQuickFormat ) SwFrmSwapper aSwapper( this, true ); TextFrmLockGuard aLock(this); - SwTextFormatInfo aInf( this, false, true ); + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true ); if( 0 != aInf.MaxHyph() ) // Respect MaxHyphen! return false; diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 741bef7..ae679c3 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1467,10 +1467,10 @@ void SwTextFormatInfo::Init() SetPaintOfst(0); } -SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL, +SwTextFormatInfo::SwTextFormatInfo(OutputDevice* pRenderContext, SwTextFrm *pFrame, const bool bInterHyphL, const bool bQuickL, const bool bTst) { - CtorInitTextFormatInfo(pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, bInterHyphL, bQuickL, bTst); + CtorInitTextFormatInfo(pRenderContext, pFrame, bInterHyphL, bQuickL, bTst); } /** diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index b7e33f4..107e6cb 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -563,7 +563,7 @@ class SwTextFormatInfo : public SwTextPaintInfo public: void CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, const bool bInterHyph = false, const bool bQuick = false, const bool bTst = false ); - SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false, + SwTextFormatInfo(OutputDevice* pRenderContext, SwTextFrm *pFrame, const bool bInterHyphL = false, const bool bQuickL = false, const bool bTst = false); // For the formatting inside a double line in a line (multi-line portion) diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index c5fe920..18f8979 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -754,7 +754,7 @@ void SwTextFrm::CalcLineSpace() Size aNewSize( Prt().SSize() ); - SwTextFormatInfo aInf( this ); + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this ); SwTextFormatter aLine( this, &aInf ); if( aLine.GetDropLines() ) { @@ -1876,7 +1876,7 @@ SwTestFormat::SwTestFormat( SwTextFrm* pTextFrm, const SwFrm* pPre, SwTwips nMax if ( pFrm->IsVertical() ) pFrm->SwapWidthAndHeight(); - SwTextFormatInfo aInf( pFrm, false, true, true ); + SwTextFormatInfo aInf( pFrm->getRootFrm()->GetCurrShell()->GetOut(), pFrm, false, true, true ); SwTextFormatter aLine( pFrm, &aInf ); pFrm->_Format( aLine, aInf ); @@ -2110,7 +2110,7 @@ SwTwips SwTextFrm::CalcFitToContent() // #i31490# TextFrmLockGuard aLock( this ); - SwTextFormatInfo aInf( this, false, true, true ); + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true, true ); aInf.SetIgnoreFly( true ); SwTextFormatter aLine( this, &aInf ); SwHookOut aHook( aInf ); @@ -2170,7 +2170,7 @@ void SwTextFrm::CalcAdditionalFirstLineOffset() TextFrmLockGuard aLock( this ); // simulate text formatting - SwTextFormatInfo aInf( this, false, true, true ); + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true, true ); aInf.SetIgnoreFly( true ); SwTextFormatter aLine( this, &aInf ); SwHookOut aHook( aInf ); diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 2365d6b..dc1a2f7 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -144,7 +144,7 @@ bool SwTextFrm::CalcPrepFootnoteAdjust() bReArrange = false; if( !pCont || !pFootnote || bReArrange != (pFootnote->FindFootnoteBossFrm() == pBoss) ) { - SwTextFormatInfo aInf( this ); + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this ); SwTextFormatter aLine( this, &aInf ); aLine.TruncLines(); SetPara( 0 ); // May be deleted! diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index 8a410b3..5bf7d25 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -28,6 +28,7 @@ #include <itrform2.hxx> #include <guess.hxx> #include <splargs.hxx> +#include <rootfrm.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -78,7 +79,7 @@ bool SwTextFrm::Hyphenate( SwInterHyphInfo &rHyphInf ) if ( IsVertical() ) SwapWidthAndHeight(); - SwTextFormatInfo aInf( this, true ); // true for interactive hyph! + SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, true ); // true for interactive hyph! SwTextFormatter aLine( this, &aInf ); aLine.CharToLine( rHyphInf.nStart ); commit a5fe6ea091ae7e897b11b62b9b749b6194d34585 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 17:12:55 2015 +0200 SwTextFormatInfo::CtorInitTextFormatInfo: use vcl::RenderContext Change-Id: I0f775bdfaf6a098be25d053f87b1bcf86d533297 diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index eb61728..79cf3f3 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1609,7 +1609,7 @@ void SwTextFrm::FormatOnceMore( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) // If something went wrong, we need to reformat again if( !bGoOn ) { - rInf.CtorInitTextFormatInfo( this ); + rInf.CtorInitTextFormatInfo( getRootFrm()->GetCurrShell()->GetOut(), this ); rLine.CtorInitTextFormatter( this, &rInf ); rLine.SetDropLines( 1 ); rLine.CalcDropHeight( 1 ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index bac9704..741bef7 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1351,10 +1351,10 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen ) return bAuto; } -void SwTextFormatInfo::CtorInitTextFormatInfo( SwTextFrm *pNewFrm, const bool bNewInterHyph, +void SwTextFormatInfo::CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pNewFrm, const bool bNewInterHyph, const bool bNewQuick, const bool bTst ) { - CtorInitTextPaintInfo( pNewFrm->getRootFrm()->GetCurrShell()->GetOut(), pNewFrm, SwRect() ); + CtorInitTextPaintInfo( pRenderContext, pNewFrm, SwRect() ); bQuick = bNewQuick; bInterHyph = bNewInterHyph; @@ -1470,7 +1470,7 @@ void SwTextFormatInfo::Init() SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL, const bool bQuickL, const bool bTst) { - CtorInitTextFormatInfo(pFrame, bInterHyphL, bQuickL, bTst); + CtorInitTextFormatInfo(pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, bInterHyphL, bQuickL, bTst); } /** diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 5cb0e50..b7e33f4 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -561,7 +561,7 @@ class SwTextFormatInfo : public SwTextPaintInfo bool _CheckFootnotePortion( SwLineLayout* pCurr ); public: - void CtorInitTextFormatInfo( SwTextFrm *pFrm, const bool bInterHyph = false, + void CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, const bool bInterHyph = false, const bool bQuick = false, const bool bTst = false ); SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false, const bool bQuickL = false, const bool bTst = false); commit d3456256eafa376abaad50dc980ab94032185af6 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 17:06:30 2015 +0200 sw: outline SwTextFormatInfo ctor Change-Id: I07b3a7768def547a34cbcdd8966157065605d5fb diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 06bdcc0..bac9704 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1467,6 +1467,12 @@ void SwTextFormatInfo::Init() SetPaintOfst(0); } +SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL, + const bool bQuickL, const bool bTst) +{ + CtorInitTextFormatInfo(pFrame, bInterHyphL, bQuickL, bTst); +} + /** * There are a few differences between a copy constructor * and the following constructor for multi-line formatting. diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 0241824..5cb0e50 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -563,9 +563,8 @@ class SwTextFormatInfo : public SwTextPaintInfo public: void CtorInitTextFormatInfo( SwTextFrm *pFrm, const bool bInterHyph = false, const bool bQuick = false, const bool bTst = false ); - inline SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false, - const bool bQuickL = false, const bool bTst = false) - { CtorInitTextFormatInfo( pFrame, bInterHyphL, bQuickL, bTst ); } + SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false, + const bool bQuickL = false, const bool bTst = false); // For the formatting inside a double line in a line (multi-line portion) // we need a modified text-format-info: commit 0c33e10b594aa07c4e9adadae59e5c03a4fdc29c Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 16:44:55 2015 +0200 SwTextPaintInfo::CtorInitTextPaintInfo: use vcl::RenderContext Change-Id: I1931ec139798d2f2eb956fd0590ab98ce1a65c3c diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 2ff3518..06bdcc0 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -487,9 +487,9 @@ bool SwTextSizeInfo::_HasHint( const SwTextNode* pTextNode, sal_Int32 nPos ) return pTextNode->GetTextAttrForCharAt(nPos); } -void SwTextPaintInfo::CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint ) +void SwTextPaintInfo::CtorInitTextPaintInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, const SwRect &rPaint ) { - CtorInitTextSizeInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame ); + CtorInitTextSizeInfo( pRenderContext, pFrame ); aTextFly.CtorInitTextFly( pFrame ), aPaintRect = rPaint; nSpaceIdx = 0; @@ -533,7 +533,7 @@ SwTextPaintInfo::SwTextPaintInfo( const SwTextPaintInfo &rInf ) SwTextPaintInfo::SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint ) { - CtorInitTextPaintInfo( pFrame, rPaint ); + CtorInitTextPaintInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, rPaint ); } extern Color aGlobalRetoucheColor; @@ -1354,7 +1354,7 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen ) void SwTextFormatInfo::CtorInitTextFormatInfo( SwTextFrm *pNewFrm, const bool bNewInterHyph, const bool bNewQuick, const bool bTst ) { - CtorInitTextPaintInfo( pNewFrm, SwRect() ); + CtorInitTextPaintInfo( pNewFrm->getRootFrm()->GetCurrShell()->GetOut(), pNewFrm, SwRect() ); bQuick = bNewQuick; bInterHyph = bNewInterHyph; diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 261392f..0241824 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -403,7 +403,7 @@ public: SwTextPaintInfo( const SwTextPaintInfo &rInf ); SwTextPaintInfo( const SwTextPaintInfo &rInf, const OUString* pText ); - void CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint ); + void CtorInitTextPaintInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, const SwRect &rPaint ); void SetBack( const SvxBrushItem *pItem, const SwRect &rRect ) { pBrushItem = pItem; aItemRect = rRect;} commit 9829d6ab01e15be7e81f971eac6ba5e402ca5189 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 16:33:37 2015 +0200 sw: outline SwTextPaintInfo ctor Change-Id: Ie57e1f5abc91286662804e7528afd062d1427fee diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 3e41ec5..2ff3518 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -531,6 +531,11 @@ SwTextPaintInfo::SwTextPaintInfo( const SwTextPaintInfo &rInf ) nSpaceIdx( rInf.GetSpaceIdx() ) { } +SwTextPaintInfo::SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint ) +{ + CtorInitTextPaintInfo( pFrame, rPaint ); +} + extern Color aGlobalRetoucheColor; /// Returns if the current background color is dark. diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 262fbb1..261392f 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -410,8 +410,7 @@ public: const SvxBrushItem *GetBrushItem() const { return pBrushItem; } const SwRect &GetBrushRect() const { return aItemRect; } - inline SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint ) - { CtorInitTextPaintInfo( pFrame, rPaint ); } + SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint ); inline SwTwips X() const { return aPos.X(); } inline void X( const long nNew ) { aPos.X() = nNew; } commit 8af3974013dbae4aa83b13c6fd6c6e8fd04ac072 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 16:23:25 2015 +0200 SwTextSizeInfo::CtorInitTextSizeInfo: use vcl::RenderContext Change-Id: I6dfceb02b57d886dd8025520e5ed21a2ad46a5b1 diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 3dae3d3..3e41ec5 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -251,7 +251,7 @@ SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew ) #endif } -void SwTextSizeInfo::CtorInitTextSizeInfo( SwTextFrm *pFrame, SwFont *pNewFnt, +void SwTextSizeInfo::CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, SwFont *pNewFnt, const sal_Int32 nNewIdx, const sal_Int32 nNewLen ) { m_pKanaComp = NULL; @@ -264,9 +264,9 @@ void SwTextSizeInfo::CtorInitTextSizeInfo( SwTextFrm *pFrame, SwFont *pNewFnt, // Get the output and reference device if ( m_pVsh ) { - m_pOut = m_pVsh->GetOut(); + m_pOut = pRenderContext; m_pRef = &m_pVsh->GetRefDev(); - m_bOnWin = m_pVsh->GetWin() || OUTDEV_WINDOW == m_pOut->GetOutDevType(); + m_bOnWin = m_pVsh->GetWin() || OUTDEV_WINDOW == m_pOut->GetOutDevType() || m_pVsh->isOutputToWindow(); } else { @@ -368,7 +368,7 @@ SwTextSizeInfo::SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt, const sal_Int32 nLength ) : m_bOnWin(false) { - CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength ); + CtorInitTextSizeInfo( pTextFrm->getRootFrm()->GetCurrShell()->GetOut(), pTextFrm, pTextFnt, nIndex, nLength ); } void SwTextSizeInfo::SelectFont() @@ -489,7 +489,7 @@ bool SwTextSizeInfo::_HasHint( const SwTextNode* pTextNode, sal_Int32 nPos ) void SwTextPaintInfo::CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint ) { - CtorInitTextSizeInfo( pFrame ); + CtorInitTextSizeInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame ); aTextFly.CtorInitTextFly( pFrame ), aPaintRect = rPaint; nSpaceIdx = 0; diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index f6f1194..262fbb1 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -191,7 +191,7 @@ protected: sal_uInt8 m_nDirection : 2; // writing direction: 0/90/180/270 degree protected: - void CtorInitTextSizeInfo( SwTextFrm *pFrm, SwFont *pFnt = 0, + void CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, SwFont *pFnt = 0, const sal_Int32 nIdx = 0, const sal_Int32 nLen = COMPLETE_STRING ); SwTextSizeInfo(); commit d7eacc579fb0874e9602b5c0714ac00bd520322a Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 15:47:15 2015 +0200 sw: outline SwTextSizeInfo ctors Change-Id: I8964701bf5b1ecdb11851d7cc8540175e007dd2b diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 861f412..3dae3d3 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -188,6 +188,35 @@ inline sal_Int32 GetMinLen( const SwTextSizeInfo &rInf ) return std::min(nTextLen, nInfLen); } +SwTextSizeInfo::SwTextSizeInfo() +: m_pKanaComp(0) +, m_pVsh(0) +, m_pOut(0) +, m_pRef(0) +, m_pFnt(0) +, m_pUnderFnt(0) +, m_pFrm(0) +, m_pOpt(0) +, m_pText(0) +, m_nIdx(0) +, m_nLen(0) +, m_nKanaIdx(0) +, m_bOnWin (false) +, m_bNotEOL (false) +, m_bURLNotify(false) +, m_bStopUnderflow(false) +, m_bFootnoteInside(false) +, m_bOtherThanFootnoteInside(false) +, m_bMulti(false) +, m_bFirstMulti(false) +, m_bRuby(false) +, m_bHanging(false) +, m_bScriptSpace(false) +, m_bForbiddenChars(false) +, m_bSnapToGrid(false) +, m_nDirection(0) +{} + SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew ) : SwTextInfo( rNew ), m_pKanaComp(rNew.GetpKanaComp()), @@ -334,6 +363,14 @@ SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew, const OUString* pTex SetLen( GetMinLen( *this ) ); } +SwTextSizeInfo::SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt, + const sal_Int32 nIndex, + const sal_Int32 nLength ) + : m_bOnWin(false) +{ + CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength ); +} + void SwTextSizeInfo::SelectFont() { // The path needs to go via ChgPhysFnt or the FontMetricCache gets confused. diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 150ef16..f6f1194 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -194,34 +194,7 @@ protected: void CtorInitTextSizeInfo( SwTextFrm *pFrm, SwFont *pFnt = 0, const sal_Int32 nIdx = 0, const sal_Int32 nLen = COMPLETE_STRING ); - SwTextSizeInfo() - : m_pKanaComp(0) - , m_pVsh(0) - , m_pOut(0) - , m_pRef(0) - , m_pFnt(0) - , m_pUnderFnt(0) - , m_pFrm(0) - , m_pOpt(0) - , m_pText(0) - , m_nIdx(0) - , m_nLen(0) - , m_nKanaIdx(0) - , m_bOnWin (false) - , m_bNotEOL (false) - , m_bURLNotify(false) - , m_bStopUnderflow(false) - , m_bFootnoteInside(false) - , m_bOtherThanFootnoteInside(false) - , m_bMulti(false) - , m_bFirstMulti(false) - , m_bRuby(false) - , m_bHanging(false) - , m_bScriptSpace(false) - , m_bForbiddenChars(false) - , m_bSnapToGrid(false) - , m_nDirection(0) - {} + SwTextSizeInfo(); public: SwTextSizeInfo( const SwTextSizeInfo &rInf ); SwTextSizeInfo( const SwTextSizeInfo &rInf, const OUString* pText, @@ -230,11 +203,7 @@ public: SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt = 0, const sal_Int32 nIndex = 0, - const sal_Int32 nLength = COMPLETE_STRING ) - : m_bOnWin(false) - { - CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength ); - } + const sal_Int32 nLength = COMPLETE_STRING ); // GetMultiAttr returns the text attribute of the multiportion, // if rPos is inside any multi-line part. commit b13fbaf697b1cbd1f8b019e3f5500b53e2a39c6c Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 14:48:09 2015 +0200 SwLayAction::FormatLayout: use vcl::RenderContext Change-Id: I3bc993b00940732fd9ca26ccec7d025c8558516a diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index 53e3c25..1dca776 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -100,7 +100,7 @@ class SwLayAction inline bool _PaintContent( const SwContentFrm *, const SwPageFrm *, const SwRect & ); - bool FormatLayout( SwLayoutFrm *, bool bAddRect = true ); + bool FormatLayout( OutputDevice* pRenderContext, SwLayoutFrm *, bool bAddRect = true ); bool FormatLayoutTab( SwTabFrm *, bool bAddRect = true ); bool FormatContent( const SwPageFrm* pPage ); void _FormatContent( const SwContentFrm* pContent, diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index af2dcdc..f25208b 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -572,7 +572,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) break; } - FormatLayout( pPage ); + FormatLayout( pRenderContext, pPage ); XCHECKPAGE; } // #i28701# - change condition @@ -755,7 +755,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) break; } - FormatLayout( pPg ); + FormatLayout( pRenderContext, pPg ); XCHECKPAGE; } @@ -1026,7 +1026,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) } } else - FormatLayout( prPage ); + FormatLayout( pSh->GetOut(), prPage ); if ( IsAgain() ) return false; } @@ -1216,7 +1216,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) } // OD 15.11.2002 #105155# - introduce support for vertical layout -bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) +bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay, bool bAddRect ) { OSL_ENSURE( !IsAgain(), "Attention to the invalid page." ); if ( IsAgain() ) @@ -1236,7 +1236,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) SwRect aOldRect( aOldFrame ); if( pLay->IsPageFrm() ) { - aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut()); + aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext); } pLay->Calc(); @@ -1264,7 +1264,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) if ( pLay->IsPageFrm() ) { SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay); - aPaint = pPageFrm->GetBoundRect(pPageFrm->getRootFrm()->GetCurrShell()->GetOut()); + aPaint = pPageFrm->GetBoundRect(pRenderContext); } bool bPageInBrowseMode = pLay->IsPageFrm(); @@ -1320,7 +1320,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) if(pSh) { SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, pSh, - pSh->GetOut(), + pRenderContext, aPageRect, pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(), pPageFrm->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT); } @@ -1335,7 +1335,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) pImp->GetShell()->AddPaintRect( aSpaceToPrevPage ); if (pSh) - pSh->GetOut()->DrawRect( aSpaceToPrevPage.SVRect() ); + pRenderContext->DrawRect( aSpaceToPrevPage.SVRect() ); // left aSpaceToPrevPage = aPageRect; @@ -1400,7 +1400,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect ); // Skip the ones already registered for deletion else if( !pLow->IsSctFrm() || static_cast<SwSectionFrm*>(pLow)->GetSection() ) - bChanged |= FormatLayout( static_cast<SwLayoutFrm*>(pLow), bAddRect ); + bChanged |= FormatLayout( pRenderContext, static_cast<SwLayoutFrm*>(pLow), bAddRect ); } else if ( pImp->GetShell()->IsPaintLocked() ) // Shortcut to minimize the cycles. With Lock, the @@ -1414,7 +1414,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) // OD 11.11.2002 #104414# - add complete frame area as paint area, if frame // area has been already added and after formatting its lowers the frame area // is enlarged. - SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut()) : pLay->Frm() ); + SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext) : pLay->Frm() ); if ( bAlreadyPainted && ( aBoundRect.Width() > aFrmAtCompletePaint.Width() || @@ -1468,7 +1468,7 @@ bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly ) if ( pLow->IsTabFrm() ) bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect ); else - bChanged |= FormatLayout( static_cast<SwLayoutFrm*>(pLow), bAddRect ); + bChanged |= FormatLayout( pImp->GetShell()->GetOut(), static_cast<SwLayoutFrm*>(pLow), bAddRect ); } pLow = pLow->GetNext(); } @@ -1615,7 +1615,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, bool bAddRect ) SwLayoutFrm *pLow = static_cast<SwLayoutFrm*>(pTab->Lower()); while ( pLow ) { - bChanged |= FormatLayout( pLow, bAddRect ); + bChanged |= FormatLayout( pImp->GetShell()->GetOut(), pLow, bAddRect ); if ( IsAgain() ) return false; pLow = static_cast<SwLayoutFrm*>(pLow->GetNext()); commit f1761903cdafd12d4b33d4e8733971a3d9ad8a10 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jun 25 16:50:00 2015 +0100 try harder to hide this from android tinderbox Change-Id: I586fea9f1570b68ed789da8b10a3b46216c42969 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index d29a956..b111b08 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -138,16 +138,16 @@ void SvpSalGraphics::clipRegion(cairo_t* cr) bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency) { -#if !ENABLE_CAIRO_CANVAS + bool bRet = false; (void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency; - return false; -#elif defined(CAIRO_VERSION) && defined(CAIRO_VERSION_ENCODE) && CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0) +#if ENABLE_CAIRO_CANVAS +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0) if (m_bUseLineColor || !m_bUseFillColor) - return false; + return bRet; cairo_t* cr = createCairoContext(m_aDevice); if (!cr) - return false; + return bRet; if (!m_aDevice->isTopDown()) { @@ -193,11 +193,10 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, xDamageTracker->damaged(basegfx::B2IBox(extents.x, extents.y, extents.x + extents.width, extents.y + extents.height)); } - return true; -#else - (void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency; - return false; + bRet = true; +#endif #endif + return bRet; } SvpSalGraphics::SvpSalGraphics() : commit f47bff9d153b4f0dcbca1cca9ba6df6491805a62 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jun 25 16:36:25 2015 +0100 implement GtkSalFrame::GetKeyName with some code lying around handy Change-Id: I6a41ae2b8056737008add98c35d06f3859e71171 diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index e566081..f759bf6 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -461,6 +461,9 @@ public: static GtkSalFrame *getFromWindow( GtkWindow *pWindow ); virtual Window GetX11Window() SAL_OVERRIDE; + + static void KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, + guint* pGdkKeyCode, GdkModifierType *pGdkModifiers); }; #define OOO_TYPE_FIXED ooo_fixed_get_type() diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 88b0bd0..8edaedc 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -2875,14 +2875,102 @@ void GtkSalFrame::Sync() gdk_display_sync( getGdkDisplay() ); } +void GtkSalFrame::KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, + guint* pGdkKeyCode, GdkModifierType *pGdkModifiers) +{ + if ( pGdkKeyCode == NULL || pGdkModifiers == NULL ) + return; + + // Get GDK key modifiers + GdkModifierType nModifiers = (GdkModifierType) 0; + + if ( rKeyCode.IsShift() ) + nModifiers = (GdkModifierType) ( nModifiers | GDK_SHIFT_MASK ); + + if ( rKeyCode.IsMod1() ) + nModifiers = (GdkModifierType) ( nModifiers | GDK_CONTROL_MASK ); + + if ( rKeyCode.IsMod2() ) + nModifiers = (GdkModifierType) ( nModifiers | GDK_MOD1_MASK ); + + *pGdkModifiers = nModifiers; + + // Get GDK keycode. + guint nKeyCode = 0; + + guint nCode = rKeyCode.GetCode(); + + if ( nCode >= KEY_0 && nCode <= KEY_9 ) + nKeyCode = ( nCode - KEY_0 ) + GDK_0; + else if ( nCode >= KEY_A && nCode <= KEY_Z ) + nKeyCode = ( nCode - KEY_A ) + GDK_A; + else if ( nCode >= KEY_F1 && nCode <= KEY_F26 ) + nKeyCode = ( nCode - KEY_F1 ) + GDK_F1; + else + { + switch( nCode ) + { + case KEY_DOWN: nKeyCode = GDK_Down; break; + case KEY_UP: nKeyCode = GDK_Up; break; + case KEY_LEFT: nKeyCode = GDK_Left; break; + case KEY_RIGHT: nKeyCode = GDK_Right; break; + case KEY_HOME: nKeyCode = GDK_Home; break; + case KEY_END: nKeyCode = GDK_End; break; + case KEY_PAGEUP: nKeyCode = GDK_Page_Up; break; + case KEY_PAGEDOWN: nKeyCode = GDK_Page_Down; break; + case KEY_RETURN: nKeyCode = GDK_Return; break; + case KEY_ESCAPE: nKeyCode = GDK_Escape; break; + case KEY_TAB: nKeyCode = GDK_Tab; break; + case KEY_BACKSPACE: nKeyCode = GDK_BackSpace; break; + case KEY_SPACE: nKeyCode = GDK_space; break; + case KEY_INSERT: nKeyCode = GDK_Insert; break; + case KEY_DELETE: nKeyCode = GDK_Delete; break; + case KEY_ADD: nKeyCode = GDK_plus; break; + case KEY_SUBTRACT: nKeyCode = GDK_minus; break; + case KEY_MULTIPLY: nKeyCode = GDK_asterisk; break; + case KEY_DIVIDE: nKeyCode = GDK_slash; break; + case KEY_POINT: nKeyCode = GDK_period; break; + case KEY_COMMA: nKeyCode = GDK_comma; break; + case KEY_LESS: nKeyCode = GDK_less; break; + case KEY_GREATER: nKeyCode = GDK_greater; break; + case KEY_EQUAL: nKeyCode = GDK_equal; break; + case KEY_FIND: nKeyCode = GDK_Find; break; + case KEY_CONTEXTMENU: nKeyCode = GDK_Menu; break; + case KEY_HELP: nKeyCode = GDK_Help; break; + case KEY_UNDO: nKeyCode = GDK_Undo; break; + case KEY_REPEAT: nKeyCode = GDK_Redo; break; + case KEY_DECIMAL: nKeyCode = GDK_KP_Decimal; break; + case KEY_TILDE: nKeyCode = GDK_asciitilde; break; + case KEY_QUOTELEFT: nKeyCode = GDK_quoteleft; break; + case KEY_BRACKETLEFT: nKeyCode = GDK_bracketleft; break; + case KEY_BRACKETRIGHT: nKeyCode = GDK_bracketright; break; + case KEY_SEMICOLON: nKeyCode = GDK_semicolon; break; + case KEY_QUOTERIGHT: nKeyCode = GDK_quoteright; break; + + // Special cases + case KEY_COPY: nKeyCode = GDK_Copy; break; + case KEY_CUT: nKeyCode = GDK_Cut; break; + case KEY_PASTE: nKeyCode = GDK_Paste; break; + case KEY_OPEN: nKeyCode = GDK_Open; break; + } + } + + *pGdkKeyCode = nKeyCode; +} + OUString GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode ) { #if !GTK_CHECK_VERSION(3,0,0) return getDisplay()->GetKeyName( nKeyCode ); #else - (void)nKeyCode; - //FIXME: key names - return OUString(); + guint nGtkKeyCode; + GdkModifierType nGtkModifiers; + KeyCodeToGdkKey(nKeyCode, &nGtkKeyCode, &nGtkModifiers ); + + gchar* pName = gtk_accelerator_get_label(nGtkKeyCode, nGtkModifiers); + OUString aRet(pName, rtl_str_getLength(pName), RTL_TEXTENCODING_UTF8); + g_free(pName); + return aRet; #endif } diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index c8bd5b0..0dce1c4 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -72,88 +72,6 @@ static gchar* GetCommandForItem( GtkSalMenuItem* pSalMenuItem, gchar* aCurrentCo return aCommand; } -static void KeyCodeToGdkKey ( const vcl::KeyCode& rKeyCode, guint* pGdkKeyCode, GdkModifierType *pGdkModifiers ) -{ - if ( pGdkKeyCode == NULL || pGdkModifiers == NULL ) - return; - - // Get GDK key modifiers - GdkModifierType nModifiers = (GdkModifierType) 0; - - if ( rKeyCode.IsShift() ) - nModifiers = (GdkModifierType) ( nModifiers | GDK_SHIFT_MASK ); - - if ( rKeyCode.IsMod1() ) - nModifiers = (GdkModifierType) ( nModifiers | GDK_CONTROL_MASK ); - - if ( rKeyCode.IsMod2() ) - nModifiers = (GdkModifierType) ( nModifiers | GDK_MOD1_MASK ); - - *pGdkModifiers = nModifiers; - - // Get GDK keycode. - guint nKeyCode = 0; - - guint nCode = rKeyCode.GetCode(); - - if ( nCode >= KEY_0 && nCode <= KEY_9 ) - nKeyCode = ( nCode - KEY_0 ) + GDK_0; - else if ( nCode >= KEY_A && nCode <= KEY_Z ) - nKeyCode = ( nCode - KEY_A ) + GDK_A; - else if ( nCode >= KEY_F1 && nCode <= KEY_F26 ) - nKeyCode = ( nCode - KEY_F1 ) + GDK_F1; - else - { - switch( nCode ) - { - case KEY_DOWN: nKeyCode = GDK_Down; break; - case KEY_UP: nKeyCode = GDK_Up; break; - case KEY_LEFT: nKeyCode = GDK_Left; break; - case KEY_RIGHT: nKeyCode = GDK_Right; break; - case KEY_HOME: nKeyCode = GDK_Home; break; - case KEY_END: nKeyCode = GDK_End; break; - case KEY_PAGEUP: nKeyCode = GDK_Page_Up; break; - case KEY_PAGEDOWN: nKeyCode = GDK_Page_Down; break; - case KEY_RETURN: nKeyCode = GDK_Return; break; - case KEY_ESCAPE: nKeyCode = GDK_Escape; break; - case KEY_TAB: nKeyCode = GDK_Tab; break; - case KEY_BACKSPACE: nKeyCode = GDK_BackSpace; break; - case KEY_SPACE: nKeyCode = GDK_space; break; - case KEY_INSERT: nKeyCode = GDK_Insert; break; - case KEY_DELETE: nKeyCode = GDK_Delete; break; - case KEY_ADD: nKeyCode = GDK_plus; break; - case KEY_SUBTRACT: nKeyCode = GDK_minus; break; - case KEY_MULTIPLY: nKeyCode = GDK_asterisk; break; - case KEY_DIVIDE: nKeyCode = GDK_slash; break; - case KEY_POINT: nKeyCode = GDK_period; break; - case KEY_COMMA: nKeyCode = GDK_comma; break; - case KEY_LESS: nKeyCode = GDK_less; break; - case KEY_GREATER: nKeyCode = GDK_greater; break; - case KEY_EQUAL: nKeyCode = GDK_equal; break; - case KEY_FIND: nKeyCode = GDK_Find; break; - case KEY_CONTEXTMENU: nKeyCode = GDK_Menu; break; - case KEY_HELP: nKeyCode = GDK_Help; break; - case KEY_UNDO: nKeyCode = GDK_Undo; break; - case KEY_REPEAT: nKeyCode = GDK_Redo; break; - case KEY_DECIMAL: nKeyCode = GDK_KP_Decimal; break; - case KEY_TILDE: nKeyCode = GDK_asciitilde; break; - case KEY_QUOTELEFT: nKeyCode = GDK_quoteleft; break; - case KEY_BRACKETLEFT: nKeyCode = GDK_bracketleft; break; - case KEY_BRACKETRIGHT: nKeyCode = GDK_bracketright; break; - case KEY_SEMICOLON: nKeyCode = GDK_semicolon; break; - case KEY_QUOTERIGHT: nKeyCode = GDK_quoteright; break; - - // Special cases - case KEY_COPY: nKeyCode = GDK_Copy; break; - case KEY_CUT: nKeyCode = GDK_Cut; break; - case KEY_PASTE: nKeyCode = GDK_Paste; break; - case KEY_OPEN: nKeyCode = GDK_Open; break; - } - } - - *pGdkKeyCode = nKeyCode; -} - bool GtkSalMenu::PrepUpdate() { const GtkSalFrame* pFrame = GetFrame(); @@ -628,8 +546,7 @@ void GtkSalMenu::NativeSetAccelerator( unsigned nSection, unsigned nItemPos, con guint nKeyCode; GdkModifierType nModifiers; - - KeyCodeToGdkKey( rKeyCode, &nKeyCode, &nModifiers ); + GtkSalFrame::KeyCodeToGdkKey(rKeyCode, &nKeyCode, &nModifiers); gchar* aAccelerator = gtk_accelerator_name( nKeyCode, nModifiers ); commit 8d5e97a7e54cde43d8f8f73d5729ab5e5bad1c34 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Jun 25 17:02:50 2015 +0200 += does not make any sense here ...although it was like that ever since its inception in 4718eab5490fd470945890d90427f87894952d5f "INTEGRATION: CWS keyconfig01," but perhaps impl_st_normPath never actually gets called with a path with leading slash, anyway. Change-Id: Ia3cf4f4020b3a9ca7152777bfa0378c28948fb8f diff --git a/framework/source/accelerators/storageholder.cxx b/framework/source/accelerators/storageholder.cxx index e22d9e6..e315ef0 100644 --- a/framework/source/accelerators/storageholder.cxx +++ b/framework/source/accelerators/storageholder.cxx @@ -494,8 +494,7 @@ OUString StorageHolder::impl_st_normPath(const OUString& sPath) OUString sNormedPath = sPath; // "/bla" => "bla" && "/" => "" (!) - if (sNormedPath.startsWith(PATH_SEPARATOR_ASCII)) - sNormedPath += sNormedPath.copy(1); + sNormedPath.startsWith(PATH_SEPARATOR_ASCII, &sNormedPath); // "/" => "" || "" => "" ? if (sNormedPath.isEmpty()) commit 5fbe0fa0dbd823b201e92e65b08742b3853ce4d1 Author: Eike Rathke <er...@redhat.com> Date: Thu Jun 25 16:37:13 2015 +0200 bail out early if maTableColumnNames.empty() Change-Id: Icda700e80aa3a48ea77b2bc90d73c37b67b62ba8 diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 113fa5f..e51da5d 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -624,6 +624,9 @@ private: sal_Int32 ScDBData::GetColumnNameOffset( const OUString& rName ) const { + if (maTableColumnNames.empty()) + return -1; + ::std::vector<OUString>::const_iterator it( ::std::find_if( maTableColumnNames.begin(), maTableColumnNames.end(), TableColumnNameSearch( rName))); if (it != maTableColumnNames.end()) commit b51fe01f7c8853c353401001bdd417b9ed27fb87 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jun 25 15:10:37 2015 +0100 WaE: error: 'CAIRO_VERSION' is not defined Change-Id: I9e4f0d0af541226089a6295962a91ca09debb418 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index f5dbaf4..d29a956 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -141,7 +141,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, #if !ENABLE_CAIRO_CANVAS (void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency; return false; -#elif CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0) +#elif defined(CAIRO_VERSION) && defined(CAIRO_VERSION_ENCODE) && CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0) if (m_bUseLineColor || !m_bUseFillColor) return false; commit a0ded09c55f944f57201651032eed5dcf7e22e48 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jun 25 10:33:06 2015 +0100 implement equalize width and height for impress/draw Equalize width/height adjusts width/height of selected objects to the width/height of the last selected object. Change-Id: I7c222a6591112cb674322d310ebd87f04a9198bd diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index cdc2308..b109e0c 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -272,6 +272,11 @@ public: // for distribution dialog function void DistributeMarkedObjects(); + // for setting either the width or height of all selected + // objects to the width/height of the last selected object + // of the selection + void EqualizeMarkedObjects(bool bWidth); + // Decompose marked polypolygon objects into polygons. // Grouped objects are searched and decomposed, if all member objects are PathObjs. // bMakeLines=TRUE: all polygones are decomposed into single lines resp. bezier segments diff --git a/include/svx/svdstr.hrc b/include/svx/svdstr.hrc index 90ef697..36e8719 100644 --- a/include/svx/svdstr.hrc +++ b/include/svx/svdstr.hrc @@ -241,7 +241,9 @@ #define STR_EditMergeSubstractPoly (STR_EditBegin + 55) #define STR_EditMergeIntersectPoly (STR_EditBegin + 56) #define STR_DistributeMarkedObjects (STR_EditBegin + 57) -#define STR_EditEnd (STR_DistributeMarkedObjects) +#define STR_EqualizeWidthMarkedObjects (STR_EditBegin + 58) +#define STR_EqualizeHeightMarkedObjects (STR_EditBegin + 59) +#define STR_EditEnd (STR_EqualizeHeightMarkedObjects) #define STR_ExchangeBegin (STR_EditEnd+1) #define STR_ExchangePaste (STR_ExchangeBegin +0) diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 5b8efbc..67ee3da 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -113,6 +113,8 @@ #define SID_POLY_INTERSECT (SID_SFX_START + 681) #define SID_POLY_FORMEN (SID_SFX_START + 682) #define SID_DISTRIBUTE_DLG (SID_SFX_START + 683) +#define SID_EQUALIZEWIDTH (SID_SFX_START + 684) +#define SID_EQUALIZEHEIGHT (SID_SFX_START + 685) // Basic IDE-Id's diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 1c679bd..d221d56 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -3472,6 +3472,16 @@ <value xml:lang="en-US">~Subtract</value> </prop> </node> + <node oor:name=".uno:EqualizeWidth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Equalize ~Width</value> + </prop> + </node> + <node oor:name=".uno:EqualizeHeight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Equalize ~Height</value> + </prop> + </node> <node oor:name=".uno:SuperScript" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Superscript</value> diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index 0b5469bf..6b2f17c 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -507,6 +507,16 @@ interface DrawView ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] + SID_EQUALIZEWIDTH // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_EQUALIZEHEIGHT // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] SID_CONNECT // ole : no, status : ? [ ExecMethod = FuTemporary ; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index ffbb503..90c3d59 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2272,6 +2272,19 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } break; + case SID_EQUALIZEWIDTH: + case SID_EQUALIZEHEIGHT: + { + // End text edit to avoid conflicts + if(mpDrawView->IsTextEdit()) + mpDrawView->SdrEndTextEdit(); + + mpDrawView->EqualizeMarkedObjects(nSId == SID_EQUALIZEWIDTH); + Cancel(); + rReq.Done (); + } + break; + case SID_DISMANTLE: // BASIC { if ( mpDrawView->IsDismantlePossible(false) ) diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 857601f..10a3f5a 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -284,13 +284,15 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet)); } - rSet.DisableItem( SID_GROUP ); - rSet.DisableItem( SID_COMBINE ); + rSet.DisableItem(SID_GROUP); + rSet.DisableItem(SID_COMBINE); rSet.DisableItem(SID_DISTRIBUTE_DLG); rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); - rSet.DisableItem( SID_CONNECT ); + rSet.DisableItem(SID_EQUALIZEWIDTH); + rSet.DisableItem(SID_EQUALIZEHEIGHT); + rSet.DisableItem(SID_CONNECT); } // multi-selection else if( nMarkCount > 1 ) @@ -377,6 +379,8 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); + rSet.DisableItem(SID_EQUALIZEWIDTH); + rSet.DisableItem(SID_EQUALIZEHEIGHT); } if (b3dObj || @@ -438,10 +442,12 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) } if ( !mpDrawView->IsCombinePossible(false) ) { - rSet.DisableItem( SID_COMBINE ); + rSet.DisableItem(SID_COMBINE); rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); + rSet.DisableItem(SID_EQUALIZEWIDTH); + rSet.DisableItem(SID_EQUALIZEHEIGHT); } if ( !mpDrawView->IsCombinePossible(true) ) { @@ -501,6 +507,8 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); + rSet.DisableItem(SID_EQUALIZEWIDTH); + rSet.DisableItem(SID_EQUALIZEHEIGHT); rSet.DisableItem( SID_CONNECT ); rSet.DisableItem( SID_ANIMATION_EFFECTS ); rSet.DisableItem( SID_MODIFY_FIELD ); diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml index f12287b..bc8cfee 100644 --- a/sd/uiconfig/sdraw/menubar/menubar.xml +++ b/sd/uiconfig/sdraw/menubar/menubar.xml @@ -346,6 +346,9 @@ <menu:menuitem menu:id=".uno:Merge"/> <menu:menuitem menu:id=".uno:Substract"/> <menu:menuitem menu:id=".uno:Intersect"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:EqualizeWidth"/> + <menu:menuitem menu:id=".uno:EqualizeHeight"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc index 9d511c8..8d82489 100644 --- a/svx/inc/globlmn_tmpl.hrc +++ b/svx/inc/globlmn_tmpl.hrc @@ -306,6 +306,20 @@ Command = ".uno:Intersect" ; \ Text [ en-US ] = "I~ntersect" ; \ }; +#define ITEM_EQUALIZEWIDTH \ + MenuItem\ + {\ + Identifier = SID_EQUALIZEWIDTH ; \ + Command = ".uno:EqualizeWidth" ; \ + Text [ en-US ] = "Equalize ~Width" ; \ + }; +#define ITEM_EQUALIZEHEIGHT \ + MenuItem\ + {\ + Identifier = SID_EQUALIZEHEIGHT ; \ + Command = ".uno:EqualizeHeight" ; \ + Text [ en-US ] = "Equalize ~Height" ; \ + }; #define MNSUB_FORMEN \ MenuItem \ @@ -320,6 +334,12 @@ ITEM_POLY_MERGE \ ITEM_POLY_SUBSTRACT \ ITEM_POLY_INTERSECT \ + MenuItem \ + { \ + Separator = TRUE; \ + }; \ + ITEM_EQUALIZEWIDTH \ + ITEM_EQUALIZEHEIGHT \ };\ };\ }; diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 941f3e8..b301c58 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -11100,6 +11100,53 @@ SfxVoidItem Substract SID_POLY_SUBSTRACT GroupId = GID_MODIFY; ] +SfxVoidItem EqualizeWidth SID_EQUALIZEWIDTH +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_MODIFY; +] + +SfxVoidItem EqualizeHeight SID_EQUALIZEHEIGHT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_MODIFY; +] SfxBoolItem SuperScript SID_SET_SUPER_SCRIPT diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 0a60082..ad7dd3f 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -1173,6 +1173,44 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode) } } +void SdrEditView::EqualizeMarkedObjects(bool bWidth) +{ + const SdrMarkList& rMarkList = GetMarkedObjectList(); + size_t nMarked = rMarkList.GetMarkCount(); + + if (nMarked < 2) + return; + + SdrObject* pLastSelectedObj = rMarkList.GetMark(nMarked-1)->GetMarkedSdrObj(); + Size aLastRectSize(pLastSelectedObj->GetLogicRect().GetSize()); + + const bool bUndo = IsUndoEnabled(); + + if (bUndo) + BegUndo(); + + for (size_t a = 0; a < nMarked-1; ++a) + { + SdrMark* pM = rMarkList.GetMark(a); + SdrObject* pObj = pM->GetMarkedSdrObj(); + Rectangle aLogicRect(pObj->GetLogicRect()); + Size aLogicRectSize(aLogicRect.GetSize()); + if (bWidth) + aLogicRectSize.Width() = aLastRectSize.Width(); + else + aLogicRectSize.Height() = aLastRectSize.Height(); + aLogicRect.SetSize(aLogicRectSize); + pObj->SetLogicRect(aLogicRect); + } + + SetUndoComment( + ImpGetResStr(bWidth ? STR_EqualizeWidthMarkedObjects : STR_EqualizeHeightMarkedObjects), + rMarkList.GetMarkDescription()); + + if (bUndo) + EndUndo(); +} + void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly) { // #105899# Start of Combine-Undo put to front, else ConvertMarkedToPolyObj would diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src index 364749a..6dc4420 100644 --- a/svx/source/svdraw/svdstr.src +++ b/svx/source/svdraw/svdstr.src @@ -823,6 +823,14 @@ String STR_DistributeMarkedObjects { Text [ en-US ] = "Distribute selected objects"; }; +String STR_EqualizeWidthMarkedObjects +{ + Text [ en-US ] = "Equalize Width %1"; +}; +String STR_EqualizeHeightMarkedObjects +{ + Text [ en-US ] = "Equalize Height %1"; +}; String STR_EditCombine_OnePoly { Text [ en-US ] = "Combine %1" ; commit df7595a5f5871f8343e4ee3869ad153e3ae4a7f3 Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Date: Thu Jun 25 16:09:35 2015 +0200 tdf#91485 fix cursors not displayed on Windows with mergedlibs Change-Id: I502d3d2490be5307364dee59c7ee36c0fb7ef55f diff --git a/Library_merged.mk b/Library_merged.mk index fa2f24d..2e482e8 100644 --- a/Library_merged.mk +++ b/Library_merged.mk @@ -36,6 +36,8 @@ $(eval $(call gb_Library_add_ldflags,merged,\ /ignore:4049 \ /ignore:4217 \ )) +# cursors +$(eval $(call gb_Library_add_nativeres,merged,vcl/salsrc)) endif ifeq ($(OS),MACOSX) commit d4ad86dac6e8971a4f21168051876a0d68f48649 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Jun 25 15:59:01 2015 +0200 ...in case this ever gets used with an unsigned APSInt of bitwidth < 7 Change-Id: Ic9436529321e523edd25d0f83ac09a0e22a44013 diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx index 20ff2a9..1280ce1 100644 --- a/compilerplugins/clang/stringconstant.cxx +++ b/compilerplugins/clang/stringconstant.cxx @@ -1191,7 +1191,7 @@ void StringConstant::handleOUStringCtor( && e3->getArg(0)->IgnoreParenImpCasts()->isIntegerConstantExpr( res, compiler.getASTContext())) { - if (res.getSExtValue() > 0 && res.getSExtValue() <= 127) { + if (res.getZExtValue() > 0 && res.getZExtValue() <= 127) { report( DiagnosticsEngine::Warning, ("in call of %0, replace OUString constructed from a (non-NUL)" commit a8cd99685abf879c56e04a95a5b2881d2adddcb9 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Jun 25 15:51:05 2015 +0200 Remove spurious negation operator again ...which had been introduced with 3f4978f8c660c595773c92b99d45d0631cac04b0 "loplugin:implicitboolconversion" when changing return name.second == sal_True; to return !name.second; Change-Id: I3d4cfb613efcc72cf01176556c678a97e5817528 diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 85ce260..feb00aa 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -265,7 +265,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn [&_rTables] (TNames::value_type name) { return !name.second; }) ) sRootEntryText = ModuleRes(STR_ALL_TABLES); else if ( ::std::none_of(_rTables.begin(),_rTables.end(), - [&_rTables] (TNames::value_type name) { return !name.second; }) ) + [&_rTables] (TNames::value_type name) { return name.second; }) ) sRootEntryText = ModuleRes(STR_ALL_VIEWS); else sRootEntryText = ModuleRes(STR_ALL_TABLES_AND_VIEWS); commit 420ed9cb1d7f164be88ee2a01f79372744ed5f03 Author: Eike Rathke <er...@redhat.com> Date: Thu Jun 25 15:37:08 2015 +0200 TableRef: compile named expression into RPN once to populate information Change-Id: Id41ca0bd6adc8152c29be4d89e9361d8fb2ffe4e diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx index a24c96a..fa2a0cf 100644 --- a/sc/source/filter/oox/defnamesbuffer.cxx +++ b/sc/source/filter/oox/defnamesbuffer.cxx @@ -387,6 +387,13 @@ std::unique_ptr<ScTokenArray> DefinedName::getScTokens() ScCompiler aCompiler(&getScDocument(), ScAddress(0, 0, mnCalcSheet)); aCompiler.SetGrammar(formula::FormulaGrammar::GRAM_OOXML); std::unique_ptr<ScTokenArray> pArray(aCompiler.CompileString(maModel.maFormula)); + // Compile the tokens into RPN once to populate information into tokens + // where necessary, e.g. for TableRef inner reference. RPN can be discarded + // after, a resulting error must be reset. + sal_uInt16 nErr = pArray->GetCodeError(); + aCompiler.CompileTokenArray(); + pArray->DelRPN(); + pArray->SetCodeError(nErr); return pArray; } commit 16e8ffbd5ec1fe7b81835ea6584547669d55d751 Author: Heena Gupta <heena.h.gu...@ericsson.com> Date: Fri May 29 16:42:34 2015 +0530 tdf#91378-Empty Custom Properties are lost while saving in .pptx format Conflicts: sd/qa/unit/export-tests.cxx Reviewed on: https://gerrit.libreoffice.org/15966 Change-Id: Ibc24ab9633b51fe41ad483121646cc391319fe6f diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 4ef16d0..f1c80df 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -539,8 +539,6 @@ OUString XmlFilterBase::addRelation( const Reference< XOutputStream >& rOutputSt static void writeElement( FSHelperPtr pDoc, sal_Int32 nXmlElement, const OUString& sValue ) { - if( sValue.isEmpty() ) - return; pDoc->startElement( nXmlElement, FSEND ); pDoc->writeEscaped( sValue ); pDoc->endElement( nXmlElement ); @@ -745,10 +743,6 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP { if ( !aprop[n].Name.isEmpty() ) { - // Ignore empty string property as well. - if (aprop[n].Value.has<OUString>() && aprop[n].Value.get<OUString>().isEmpty()) - continue; - OString aName = OUStringToOString( aprop[n].Name, RTL_TEXTENCODING_ASCII_US ); // pid starts from 2 not from 1 as MS supports pid from 2 pAppProps->startElement( XML_property , diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index f118a5d..79ab899 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -1037,8 +1037,7 @@ void FastSaxParserImpl::parse() void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xmlChar* prefix, const xmlChar* URI, int numNamespaces, const xmlChar** namespaces, int numAttributes, int /*defaultedAttributes*/, const xmlChar **attributes) { - if( !pendingCharacters.isEmpty()) - sendPendingCharacters(); + sendPendingCharacters(); Entity& rEntity = getEntity(); if( rEntity.maNamespaceCount.empty() ) { @@ -1145,8 +1144,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm void FastSaxParserImpl::callbackEndElement( const xmlChar*, const xmlChar*, const xmlChar* ) { - if( !pendingCharacters.isEmpty()) - sendPendingCharacters(); + sendPendingCharacters(); Entity& rEntity = getEntity(); SAL_WARN_IF(rEntity.maNamespaceCount.empty(), "sax", "Empty NamespaceCount"); if( !rEntity.maNamespaceCount.empty() ) diff --git a/sd/qa/unit/data/pptx/tdf91378.pptx b/sd/qa/unit/data/pptx/tdf91378.pptx new file mode 100644 index 0000000..361be2c Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf91378.pptx differ diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index d8cd85f..3c72207 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -122,6 +122,7 @@ public: void testTransparentBackground(); void testFdo90607(); + void testTdf91378(); #if !defined WNT void testBnc822341(); #endif @@ -155,6 +156,7 @@ public: CPPUNIT_TEST(testBulletMarginAndIndentation); CPPUNIT_TEST(testParaMarginAndindentation); CPPUNIT_TEST(testTransparentBackground); + CPPUNIT_TEST(testTdf91378); #if !defined WNT CPPUNIT_TEST(testBnc822341); @@ -951,6 +953,26 @@ void SdExportTest::testBulletColor() CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", sal_uInt32(0xff0000),pNumFmt->GetNumRule()->GetLevel(0).GetBulletColor().GetColor()); } +void SdExportTest::testTdf91378() +{ + + //Check For Import and Export Both + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/tdf91378.pptx"), PPTX); + for( sal_uInt32 i=0;i<2;i++) + { + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier( xDocShRef->GetModel(), uno::UNO_QUERY ); + uno::Reference<document::XDocumentProperties> xProps( xDocumentPropertiesSupplier->getDocumentProperties(), uno::UNO_QUERY ); + uno::Reference<beans::XPropertySet> xUDProps( xProps->getUserDefinedProperties(), uno::UNO_QUERY ); + OUString propValue; + xUDProps->getPropertyValue(OUString("Testing")) >>= propValue; + CPPUNIT_ASSERT(propValue.isEmpty()); + xDocShRef = saveAndReload( xDocShRef, PPTX ); + } + xDocShRef->DoClose(); +} + #if !defined WNT void SdExportTest::testBnc822341() commit b4a224d1a91232a16b70be4531a3e6fd2d9bc9ae Author: Rosemary <rosemarys...@gmail.com> Date: Tue Jun 23 14:34:06 2015 +0530 tdf#80387 Extended lint-ui.py to check for UI title labels Change-Id: I47ab882b0d54711050da4fc8fa288b195949eb60 Reviewed-on: https://gerrit.libreoffice.org/16425 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/bin/lint-ui.py b/bin/lint-ui.py index 54e1d27..2ed80c2 100755 --- a/bin/lint-ui.py +++ b/bin/lint-ui.py @@ -11,6 +11,7 @@ import sys import xml.etree.ElementTree as ET +import re DEFAULT_WARNING_STR = 'Lint assertion failed' @@ -23,6 +24,8 @@ ALIGNMENT_TOP_PADDING = '6' MESSAGE_BOX_SPACING = '24' MESSAGE_BORDER_WIDTH = '12' +IGNORED_WORDS = ['the', 'of', 'to', 'for', 'a', 'and', 'as', 'from', 'on', 'into', 'by', 'at', 'or', 'do', 'in', 'when'] + def lint_assert(predicate, warning=DEFAULT_WARNING_STR): if not predicate: print(" * " + warning) @@ -77,6 +80,19 @@ def check_alignment_top_padding(alignment): lint_assert(top_padding.text == ALIGNMENT_TOP_PADDING, "GtkAlignment 'top_padding' should be " + ALIGNMENT_TOP_PADDING) +def check_title_labels(root): + labels = root.findall(".//child[@type='label']") + titles = [label.find(".//property[@name='label']") for label in labels] + for title in titles: + if title is None: + continue + words = re.split(r'[^a-zA-Z0-9_-]', title.text) + first = True + for word in words: + if word[0].islower() and (word not in IGNORED_WORDS or first): + lint_assert(False, "The word '" + word + "' should be capitalized") + first = False + def main(): print(" == " + sys.argv[1] + " ==") tree = ET.parse(sys.argv[1]) @@ -102,5 +118,7 @@ def main(): check_frames(root) + check_title_labels(root) + if __name__ == "__main__": main() commit 3f4978f8c660c595773c92b99d45d0631cac04b0 Author: Noel Grandin <n...@peralex.com> Date: Thu Jun 25 15:04:59 2015 +0200 loplugin:implicitboolconversion Change-Id: Ib266bc70a99d84d4e3d845573f39e612dc6595f8 diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 789f774..85ce260 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -262,10 +262,10 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn { OUString sRootEntryText; if ( ::std::none_of(_rTables.begin(),_rTables.end(), - [&_rTables] (TNames::value_type name) { return name.second == sal_False; }) ) + [&_rTables] (TNames::value_type name) { return !name.second; }) ) sRootEntryText = ModuleRes(STR_ALL_TABLES); else if ( ::std::none_of(_rTables.begin(),_rTables.end(), - [&_rTables] (TNames::value_type name) { return name.second == sal_True; }) ) + [&_rTables] (TNames::value_type name) { return !name.second; }) ) sRootEntryText = ModuleRes(STR_ALL_VIEWS); else sRootEntryText = ModuleRes(STR_ALL_TABLES_AND_VIEWS); commit 8bd2333e3636bc1e196fb7fccd73a0dc8518fa76 Author: Noel Grandin <n...@peralex.com> Date: Thu Jun 25 15:03:31 2015 +0200 remove custom RTTI from SdrObjPlusData not used anywhere Change-Id: I72e8f1862dd9075c548d178f93cd72fa32a56809 diff --git a/svx/source/inc/svdobjplusdata.hxx b/svx/source/inc/svdobjplusdata.hxx index 7920df3..8f7c1a7 100644 --- a/svx/source/inc/svdobjplusdata.hxx +++ b/svx/source/inc/svdobjplusdata.hxx @@ -10,7 +10,6 @@ #ifndef INCLUDED_SVX_SVDOBJPLUSDATA_HXX #define INCLUDED_SVX_SVDOBJPLUSDATA_HXX -#include <tools/rtti.hxx> #include <rtl/ustring.hxx> class SdrObject; @@ -34,7 +33,6 @@ class SdrObjPlusData OUString aObjDescription; public: - TYPEINFO(); SdrObjPlusData(); virtual ~SdrObjPlusData(); SdrObjPlusData* Clone(SdrObject* pObj1) const; diff --git a/svx/source/svdraw/svdobjplusdata.cxx b/svx/source/svdraw/svdobjplusdata.cxx index cc8fd35..e9d0696 100644 --- a/svx/source/svdraw/svdobjplusdata.cxx +++ b/svx/source/svdraw/svdobjplusdata.cxx @@ -14,8 +14,6 @@ #include <svl/SfxBroadcaster.hxx> -TYPEINIT0(SdrObjPlusData); - SdrObjPlusData::SdrObjPlusData(): pBroadcast(NULL), pUserDataList(NULL), commit 4fc13975ad83fd2e95d2383ab0e9af688c47710d Author: Eike Rathke <er...@redhat.com> Date: Thu Jun 25 14:46:55 2015 +0200 TableRef: ScCompiler::IsTableRefColumn() lookup column name in ScDBData ... as a fallback for named expressions during document import when cell content isn't available yet. Change-Id: I134ac2aaeb5f336703edbadfd6664d916d2c5885 diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 11aa239..3594f0e 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3495,6 +3495,22 @@ bool ScCompiler::IsTableRefColumn( const OUString& rName ) const } } } + + // And now a fallback for named expressions during document load time when + // cell content isn't available yet. This could be the preferred method IF + // the ScDBData column names were maintained and refreshed on ALL sheet + // operations, including cell content changes. + sal_Int32 nOffset = pDBData->GetColumnNameOffset( aName); + if (nOffset >= 0) + { + ScSingleRefData aRef; + ScAddress aAdr( aRange.aStart); + aAdr.IncCol( nOffset); + aRef.InitAddress( aAdr); + maRawToken.SetSingleReference( aRef ); + return true; + } + return false; } commit cd3486798496545271baa2cb5d7beb6f0a99dcca Author: Eike Rathke <er...@redhat.com> Date: Thu Jun 25 14:45:37 2015 +0200 TableRef: search table column names case insensitive Change-Id: I753a4511aa2c1e37b83094189902ce7031d68c04 diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index ef39e8b..113fa5f 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -603,10 +603,29 @@ void ScDBData::AdjustTableColumnNames( UpdateRefMode eUpdateRefMode, SCCOL nDx, aNewNames.swap( maTableColumnNames); } +namespace { +class TableColumnNameSearch : public unary_function<ScDBData, bool> +{ +public: + explicit TableColumnNameSearch( const OUString& rSearchName ) : + maSearchName( rSearchName ) + { + } + + bool operator()( const OUString& rName ) const + { + return ScGlobal::GetpTransliteration()->isEqual( maSearchName, rName); + } + +private: + OUString maSearchName; +}; +} + sal_Int32 ScDBData::GetColumnNameOffset( const OUString& rName ) const { ::std::vector<OUString>::const_iterator it( - ::std::find( maTableColumnNames.begin(), maTableColumnNames.end(), rName)); + ::std::find_if( maTableColumnNames.begin(), maTableColumnNames.end(), TableColumnNameSearch( rName))); if (it != maTableColumnNames.end()) return it - maTableColumnNames.begin(); commit 58b0c0cf0c1429ec2f7f5ef8fc9ebc4840ace92d Author: Eike Rathke <er...@redhat.com> Date: Thu Jun 25 14:43:18 2015 +0200 TableRef: move getTables().applyTableColumns() to the correct position ... in import sequence. Change-Id: Ib5601af281f0378d283ecd61fa71c41e6c1be254 diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index 342be2b..4b37d0f 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -461,6 +461,7 @@ void WorkbookFragment::finalizeImport() // create all database ranges and defined names, in that order getTables().finalizeImport(); + getTables().applyTableColumns(); getDefinedNames().finalizeImport(); // open the VBA project storage OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATION_TYPE( "vbaProject" ) ); diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 9875f0e..d74f344 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -943,7 +943,6 @@ void WorksheetGlobals::finalizeWorksheetImport() // assumes getTables().finalizeImport ( which creates the DatabaseRanges ) // has been called already getTables().applyAutoFilters(); - getTables().applyTableColumns(); getCondFormats().finalizeImport(); lclUpdateProgressBar( mxFinalProgress, 0.25 ); commit 3928a1514c9202a52d698570022c197ecc8703eb Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jun 25 13:41:58 2015 +0100 error: missing binary operator before token '(' Change-Id: Ieafb13245a11347cbda8a33e49ad618bf85d8a89 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 957463b..f5dbaf4 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -138,7 +138,10 @@ void SvpSalGraphics::clipRegion(cairo_t* cr) bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency) { -#if ENABLE_CAIRO_CANVAS && CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0) +#if !ENABLE_CAIRO_CANVAS + (void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency; + return false; +#elif CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0) if (m_bUseLineColor || !m_bUseFillColor) return false; @@ -192,11 +195,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, } return true; #else - (void)nX; - (void)nY; - (void)nWidth; - (void)nHeight; - (void)nTransparency; + (void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency; return false; #endif } commit 08b3b6ed6c4d8599c9bb75719974c710462f2764 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 14:13:44 2015 +0200 SwLayAction::Action: use vcl::RenderContext Change-Id: I4fb6c42da0c5defa1d5da4cf6f3a13d11388c88d diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index e85ff36..53e3c25 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -154,7 +154,7 @@ public: inline void SetCheckPageNum( sal_uInt16 nNew ); inline void SetCheckPageNumDirect( sal_uInt16 nNew ) { nCheckPageNum = nNew; } - void Action(); // here it begins + void Action(OutputDevice* pRenderContext); // here it begins void Reset(); // back to CTor-defaults bool IsAgain() const { return bAgain; } diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index f140b71..af2dcdc 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -341,7 +341,7 @@ bool SwLayAction::RemoveEmptyBrowserPages() return bRet; } -void SwLayAction::Action() +void SwLayAction::Action(OutputDevice* pRenderContext) { bActionInProgress = true; @@ -366,12 +366,12 @@ void SwLayAction::Action() if ( IsCalcLayout() ) SetCheckPages( false ); - InternalAction(pImp->GetShell()->GetOut()); + InternalAction(pRenderContext); bAgain |= RemoveEmptyBrowserPages(); while ( IsAgain() ) { bAgain = bNextCycle = false; - InternalAction(pImp->GetShell()->GetOut()); + InternalAction(pRenderContext); bAgain |= RemoveEmptyBrowserPages(); } pRoot->DeleteEmptySct(); @@ -2166,7 +2166,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewShellImp *pI ) : aAction.SetInputType( VCL_INPUT_ANY ); aAction.SetIdle( true ); aAction.SetWaitAllowed( false ); - aAction.Action(); + aAction.Action(pImp->GetShell()->GetOut()); bInterrupt = aAction.IsInterrupt(); } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 6587b90..017389b 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3237,7 +3237,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S aAction.SetPaint( false ); aAction.SetComplete( false ); aAction.SetReschedule( gProp.pSProgress != nullptr ); - aAction.Action(); + aAction.Action(&rRenderContext); ResetTurboFlag(); if ( !pSh->ActionPend() ) pSh->Imp()->DelRegion(); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index c9ad763..4ace932 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -283,7 +283,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd ) if ( mnLockPaint ) aAction.SetPaint( false ); aAction.SetInputType( VclInputFlags::KEYBOARD ); - aAction.Action(); + aAction.Action(GetWin()); } if ( bIsShellForCheckViewLayout ) @@ -948,7 +948,7 @@ void SwViewShell::CalcLayout() aAction.SetCalcLayout( true ); aAction.SetReschedule( true ); GetDoc()->getIDocumentFieldsAccess().LockExpFields(); - aAction.Action(); + aAction.Action(GetOut()); GetDoc()->getIDocumentFieldsAccess().UnlockExpFields(); //the SetNewFieldLst() on the Doc was cut off and must be fetched again @@ -964,7 +964,7 @@ void SwViewShell::CalcLayout() GetDoc()->getIDocumentFieldsAccess().UpdatePageFields( &aMsgHint ); GetDoc()->getIDocumentFieldsAccess().UpdateExpFields(NULL, true); - aAction.Action(); + aAction.Action(GetOut()); } if ( VisArea().HasArea() ) @@ -1596,7 +1596,7 @@ bool SwViewShell::CheckInvalidForPaint( const SwRect &rRect ) // can't format frames which are locked by the outer action. This may // cause and endless loop. ++mnStartAction; - aAction.Action(); + aAction.Action(GetWin()); --mnStartAction; SwRegionRects *pRegion = Imp()->GetRegion(); diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 631f69a..4bec7c6 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -312,7 +312,7 @@ void SwViewShell::CalcPagesForPrint( sal_uInt16 nMax ) aAction.SetWaitAllowed( false ); aAction.SetReschedule( true ); - aAction.Action(); + aAction.Action(GetOut()); maVisArea = aOldVis; //reset due to the paints Imp()->SetFirstVisPageInvalid(); commit 1a2705d16c945cdd85dd75c803039c05af0c853c Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 12:27:54 2015 +0200 SwLayAction::InternalAction: use vcl::RenderContext Change-Id: Icbc5e9a42cc7e7693c6584461505a3233046272c diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index 6977627..e85ff36 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -109,7 +109,7 @@ class SwLayAction bool TurboAction(); bool _TurboAction( const SwContentFrm * ); - void InternalAction(); + void InternalAction(OutputDevice* pRenderContext); static SwPageFrm *CheckFirstVisPage( SwPageFrm *pPage ); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 737c4ec..f140b71 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -366,12 +366,12 @@ void SwLayAction::Action() if ( IsCalcLayout() ) SetCheckPages( false ); - InternalAction(); + InternalAction(pImp->GetShell()->GetOut()); bAgain |= RemoveEmptyBrowserPages(); while ( IsAgain() ) { bAgain = bNextCycle = false; - InternalAction(); + InternalAction(pImp->GetShell()->GetOut()); bAgain |= RemoveEmptyBrowserPages(); } pRoot->DeleteEmptySct(); @@ -442,7 +442,7 @@ static void unlockPositionOfObjects( SwPageFrm *pPageFrm ) } } -void SwLayAction::InternalAction() +void SwLayAction::InternalAction(OutputDevice* pRenderContext) { OSL_ENSURE( pRoot->Lower()->IsPageFrm(), ":-( No page below the root."); @@ -454,7 +454,7 @@ void SwLayAction::InternalAction() // number 1. If we're doing a fake formatting, the number of the first // page is the number of the first visible page. SwPageFrm *pPage = IsComplete() ? static_cast<SwPageFrm*>(pRoot->Lower()) : - pImp->GetFirstVisPage(pImp->GetShell()->GetOut()); + pImp->GetFirstVisPage(pRenderContext); if ( !pPage ) pPage = static_cast<SwPageFrm*>(pRoot->Lower()); @@ -621,7 +621,7 @@ void SwLayAction::InternalAction() if( !IsComplete() && nPreInvaPage + 2 < nFirstPageNum ) { pImp->SetFirstVisPageInvalid(); - SwPageFrm *pTmpPage = pImp->GetFirstVisPage(pImp->GetShell()->GetOut()); + SwPageFrm *pTmpPage = pImp->GetFirstVisPage(pRenderContext); nFirstPageNum = pTmpPage->GetPhyPageNum(); if( nPreInvaPage < nFirstPageNum ) { commit c369f8644c45869cb1d80e5e243e445f5cb8b778 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 12:15:41 2015 +0200 SwPageFrm::GetHorizontalShadowRect: use vcl::RenderContext Change-Id: Ife6c7404079aa1ae10d5c2bdbe77629e0689b167 diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 5b4f87d..99097a9 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -96,6 +96,7 @@ class SwPageFrm: public SwFootnoteBossFrm static void GetHorizontalShadowRect( const SwRect& _rPageRect, const SwViewShell* _pViewShell, + OutputDevice* pRenderContext, SwRect& _orBottomShadowRect, bool bPaintLeftShadow, bool bPaintRightShadow, diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 6984d8c..6587b90 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -6029,6 +6029,7 @@ bool SwPageFrm::IsLeftShadowNeeded() const */ /*static*/ void SwPageFrm::GetHorizontalShadowRect( const SwRect& _rPageRect, const SwViewShell* _pViewShell, + OutputDevice* pRenderContext, SwRect& _orHorizontalShadowRect, bool bPaintLeftShadow, bool bPaintRightShadow, @@ -6036,9 +6037,8 @@ bool SwPageFrm::IsLeftShadowNeeded() const { const SwPostItMgr *pMgr = _pViewShell->GetPostItMgr(); SwRect aAlignedPageRect( _rPageRect ); - ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() ); - SwRect aPagePxRect = - _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() ); + ::SwAlignRect( aAlignedPageRect, _pViewShell, pRenderContext ); + SwRect aPagePxRect = pRenderContext->LogicToPixel( aAlignedPageRect.SVRect() ); long lShadowAdjustment = mnShadowPxWidth - 1; // TODO: extract this @@ -6177,7 +6177,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin SwRect aPaintRect; OutputDevice *pOut = _pViewShell->GetOut(); - SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, aPaintRect, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); + SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, pOut, aPaintRect, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); // Right shadow & corners if ( bPaintRightShadow ) @@ -6386,7 +6386,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin // Always ask for full shadow since we want a bounding rect // including at least the page frame - SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, aTmpRect, false, false, bRightSidebar ); + SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, pRenderContext, aTmpRect, false, false, bRightSidebar ); if(bLeftShadow) aPagePxRect.Left( aTmpRect.Left() - mnShadowPxWidth - 1); if(bRightShadow) aPagePxRect.Right( aTmpRect.Right() + mnShadowPxWidth + 1); commit cec17a4659389c5fe3a97c144d541c6aedc64d3f Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jun 25 12:04:26 2015 +0200 SwViewShellImp::GetFirstVisPage: use vcl::RenderContext Change-Id: I7acd380d2e199f042dca61d95596c3bc63c6a206 diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index c01966b..131b1da 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1144,7 +1144,7 @@ void SwCrsrShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, if( !bAtCrsrPos || 0 == (pCFrm = GetCurrFrm( bCalcFrm )) || 0 == (pPg = pCFrm->FindPageFrm()) ) { - pPg = Imp()->GetFirstVisPage(); + pPg = Imp()->GetFirstVisPage(GetOut()); while( pPg && pPg->IsEmptyPage() ) pPg = static_cast<const SwPageFrm *>(pPg->GetNext()); } @@ -1157,7 +1157,7 @@ sal_uInt16 SwCrsrShell::GetNextPrevPageNum( bool bNext ) { SET_CURR_SHELL( this ); // page number: first visible page or the one at the cursor - const SwPageFrm *pPg = Imp()->GetFirstVisPage(); + const SwPageFrm *pPg = Imp()->GetFirstVisPage(GetOut()); if( pPg ) { const SwTwips nPageTop = pPg->Frm().Top(); diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index fe774a1..db5707c 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -158,7 +158,7 @@ const SdrPageGridFrameList* SwDPage::GetGridFrameList( else { //The drawing demands all visible pages - const SwFrm *pPg = pSh->Imp()->GetFirstVisPage(); + const SwFrm *pPg = pSh->Imp()->GetFirstVisPage(pSh->GetOut()); if ( pPg ) do { ::InsertGridFrame( const_cast<SwDPage*>(this)->pGridLst, pPg ); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 44dd490..0c46506 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -186,7 +186,7 @@ bool SwFEShell::GetPageNumber( long nYPos, bool bAtCrsrPos, sal_uInt16& rPhyNum, } else // first visible page { - pPage = Imp()->GetFirstVisPage(); + pPage = Imp()->GetFirstVisPage(GetOut()); if ( pPage && static_cast<const SwPageFrm*>(pPage)->IsEmptyPage() ) pPage = pPage->GetNext(); } diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index ecfd426..3146ec3 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -146,8 +146,8 @@ public: Color GetRetoucheColor() const; /// Management of the first visible Page - const SwPageFrm *GetFirstVisPage() const; - SwPageFrm *GetFirstVisPage(); + const SwPageFrm *GetFirstVisPage(OutputDevice* pRenderContext) const; + SwPageFrm *GetFirstVisPage(OutputDevice* pRenderContext); void SetFirstVisPageInvalid() { bFirstPageInvalid = true; } bool AddPaintRect( const SwRect &rRect ); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 8eb237a..737c4ec 100644 ... etc. - the rest is truncated
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits