[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx

2023-11-07 Thread Noel Grandin (via logerrit)
 vcl/inc/unx/cupsmgr.hxx |4 +++-
 vcl/source/window/menubarwindow.cxx |4 ++--
 vcl/source/window/menubarwindow.hxx |2 +-
 vcl/unx/generic/printer/cupsmgr.cxx |   12 ++--
 4 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit c049ac6503c0f0f6bb7170b68c19ccb400c525f7
Author: Noel Grandin 
AuthorDate: Tue Nov 7 13:48:52 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Nov 8 06:02:12 2023 +0100

loplugin:fieldcast in CUPSManager

Change-Id: I97cf8b9dc0553b9771209bde3fd9ae0301012186
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159086
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/unx/cupsmgr.hxx b/vcl/inc/unx/cupsmgr.hxx
index 36d837d558b7..096efdea6e77 100644
--- a/vcl/inc/unx/cupsmgr.hxx
+++ b/vcl/inc/unx/cupsmgr.hxx
@@ -24,6 +24,8 @@
 #include 
 #include 
 
+class cups_dest_s;
+
 namespace psp
 {
 
@@ -39,7 +41,7 @@ class CUPSManager final : public PrinterInfoManager
 {
 std::unordered_map< FILE*, OString, FPtrHash > m_aSpoolFiles;
 intm_nDests;
-void*  m_pDests;
+cups_dest_s*   m_pDests;
 bool   m_bNewDests;
 std::unordered_map< OUString, int >  m_aCUPSDestMap;
 
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx 
b/vcl/unx/generic/printer/cupsmgr.cxx
index b81f630cd788..1fab7a172353 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -214,7 +214,7 @@ CUPSManager::~CUPSManager()
 }
 
 if (m_nDests && m_pDests)
-cupsFreeDests( m_nDests, static_cast(m_pDests) );
+cupsFreeDests( m_nDests, m_pDests );
 }
 
 void CUPSManager::runDestThread( void* pThis )
@@ -325,7 +325,7 @@ void CUPSManager::initialize()
 // introduced in dests with 1.2
 // this is needed to check for %%IncludeFeature support
 // (#i65684#, #i65491#)
-cups_dest_t* pDest = static_cast(m_pDests);
+cups_dest_t* pDest = m_pDests;
 
 rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
 int nPrinter = m_nDests;
@@ -338,7 +338,7 @@ void CUPSManager::initialize()
 // with the same name as a CUPS printer, overwrite it
 while( nPrinter-- )
 {
-pDest = static_cast(m_pDests)+nPrinter;
+pDest = m_pDests+nPrinter;
 OUString aPrinterName = OStringToOUString( pDest->name, aEncoding );
 if( pDest->instance && *pDest->instance )
 {
@@ -470,7 +470,7 @@ const PPDParser* CUPSManager::createCUPSParser( const 
OUString& rPrinter )
 m_aCUPSDestMap.find( aPrinter );
 if( dest_it != m_aCUPSDestMap.end() )
 {
-cups_dest_t* pDest = static_cast(m_pDests) + 
dest_it->second;
+cups_dest_t* pDest = m_pDests + dest_it->second;
 OString aPPDFile = threadedCupsGetPPD( pDest->name );
 SAL_INFO("vcl.unx.print",
 "PPD for " << aPrinter << " is " << aPPDFile);
@@ -890,7 +890,7 @@ bool CUPSManager::endSpool( const OUString& rPrintername, 
const OUString& rJobTi
 sJobName = OUStringToOString(rFaxNumber, aEnc);
 }
 
-cups_dest_t* pDest = static_cast(m_pDests) + 
dest_it->second;
+cups_dest_t* pDest = m_pDests + dest_it->second;
 nJobID = cupsPrintFile(pDest->name,
 it->second.getStr(),
 sJobName.getStr(),
@@ -943,7 +943,7 @@ bool CUPSManager::checkPrintersChanged( bool bWait )
 // there is no way to query CUPS whether the printer list has 
changed
 // so get the dest list anew
 if( m_nDests && m_pDests )
-cupsFreeDests( m_nDests, static_cast(m_pDests) );
+cupsFreeDests( m_nDests, m_pDests );
 m_nDests = 0;
 m_pDests = nullptr;
 runDests();
commit 1f27c361531af17a13510deb86f0b8917d4d4276
Author: Noel Grandin 
AuthorDate: Tue Nov 7 13:31:14 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Nov 8 06:02:00 2023 +0100

loplugin:fieldcast in MenuBarWindow

Change-Id: I2b8d8ce3bd20166637d1051fd0d4407a9b2a76b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159084
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/window/menubarwindow.cxx 
b/vcl/source/window/menubarwindow.cxx
index 89e6b9246148..e77b600ea445 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -224,7 +224,7 @@ IMPL_LINK_NOARG(MenuBarWindow, CloseHdl, ToolBox *, void)
 // #i106052# call close hdl asynchronously to ease handler 
implementation
 // this avoids still being in the handler while the DecoToolBox already
 // gets destroyed
-
Application::PostUserEvent(static_cast(m_pMenu.get())->GetCloseButtonClickHdl());
+

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx xmlhelp/source

2021-02-18 Thread Noel (via logerrit)
 vcl/inc/graphic/UnoGraphic.hxx|4 -
 vcl/inc/graphic/UnoGraphicDescriptor.hxx  |3 
 vcl/inc/unx/gtk/gtkdata.hxx   |   63 +++-
 vcl/source/app/salvtables.cxx |6 -
 vcl/source/app/unohelp2.cxx   |2 
 vcl/source/control/edit.cxx   |5 -
 vcl/source/edit/textview.cxx  |7 --
 vcl/source/gdi/graph.cxx  |2 
 vcl/source/gdi/pdfwriter_impl2.cxx|2 
 vcl/source/gdi/vectorgraphicdata.cxx  |3 
 vcl/source/graphic/UnoGraphicProvider.cxx |   12 +--
 vcl/unx/gtk3/a11y/gtk3atkutil.cxx |   68 --
 vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx |6 -
 vcl/unx/gtk3/fpicker/SalGtkFolderPicker.cxx   |3 
 vcl/unx/gtk3/gtk3gtkdata.cxx  |1 
 vcl/unx/gtk3/gtk3gtkframe.cxx |2 
 xmlhelp/source/cxxhelp/provider/resultsetbase.cxx |4 -
 xmlhelp/source/treeview/tvfactory.cxx |3 
 18 files changed, 90 insertions(+), 106 deletions(-)

New commits:
commit 7b649f835cc00ed76927c6821a135605609bed4e
Author: Noel 
AuthorDate: Fri Feb 19 08:40:18 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 19 08:46:44 2021 +0100

loplugin:refcounting in vcl

Change-Id: Ieca3dd33a7ae40c3f7b8ba30f763d71a548cd144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/71
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/graphic/UnoGraphic.hxx b/vcl/inc/graphic/UnoGraphic.hxx
index 33f97df5b183..be2991eb6a5d 100644
--- a/vcl/inc/graphic/UnoGraphic.hxx
+++ b/vcl/inc/graphic/UnoGraphic.hxx
@@ -44,14 +44,12 @@ public:
 using ::unographic::GraphicDescriptor::init;
 void init(const ::Graphic& rGraphic);
 
-private:
-
 // XInterface
 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & 
rType ) override;
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & 
rType ) override;
 virtual void SAL_CALL acquire() throw() override;
 virtual void SAL_CALL release() throw() override;
-
+private:
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;
diff --git a/vcl/inc/graphic/UnoGraphicDescriptor.hxx 
b/vcl/inc/graphic/UnoGraphicDescriptor.hxx
index ad46952ce925..db39c070deda 100644
--- a/vcl/inc/graphic/UnoGraphicDescriptor.hxx
+++ b/vcl/inc/graphic/UnoGraphicDescriptor.hxx
@@ -74,8 +74,6 @@ public:
 void init( const OUString& rURL );
 void init( const css::uno::Reference< css::io::XInputStream >& rxIStm, 
const OUString& rURL );
 
-protected:
-
 static rtl::Reference<::comphelper::PropertySetInfo> 
createPropertySetInfo();
 
 // XInterface
@@ -84,6 +82,7 @@ protected:
 virtual void SAL_CALL acquire() throw() override;
 virtual void SAL_CALL release() throw() override;
 
+protected:
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index 2f88ffe8b309..976412cfb6d5 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -25,6 +25,8 @@
 #include 
 #include 
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -58,6 +60,64 @@ public:
 sal_uLongm_nTimeoutMS;
 };
 
+class DocumentFocusListener :
+public ::cppu::WeakImplHelper< 
css::accessibility::XAccessibleEventListener >
+{
+
+o3tl::sorted_vector< css::uno::Reference< css::uno::XInterface > > 
m_aRefList;
+
+public:
+/// @throws lang::IndexOutOfBoundsException
+/// @throws uno::RuntimeException
+void attachRecursive(
+const css::uno::Reference< css::accessibility::XAccessible >& 
xAccessible
+);
+
+/// @throws lang::IndexOutOfBoundsException
+/// @throws uno::RuntimeException
+void attachRecursive(
+const css::uno::Reference< css::accessibility::XAccessible >& 
xAccessible,
+const css::uno::Reference< css::accessibility::XAccessibleContext >& 
xContext
+);
+
+/// @throws lang::IndexOutOfBoundsException
+/// @throws uno::RuntimeException
+void attachRecursive(
+const css::uno::Reference< css::accessibility::XAccessible >& 
xAccessible,
+const css::uno::Reference< css::accessibility::XAccessibleContext >& 
xContext,
+const css::uno::Reference< css::accessibility::XAccessibleStateSet >& 
xStateSet
+);
+
+/// @throws lang::IndexOutOfBoundsException
+/// @throws uno::RuntimeException
+void detachRecursive(
+const css::uno::Reference< css::accessibility::XAccessible >& 
xAccessible
+);
+
+/// @throws lang::IndexOutOfBoundsException
+/// @throws 

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx

2019-11-12 Thread Michael Weghorn (via logerrit)
 vcl/inc/strings.hrc|1 -
 vcl/source/window/printdlg.cxx |1 +
 vcl/unx/generic/print/prtsetup.cxx |   11 ---
 vcl/unx/generic/print/prtsetup.hxx |2 --
 4 files changed, 1 insertion(+), 14 deletions(-)

New commits:
commit eeae2032476e8c8645ab438fbb379f3151c8e472
Author: Michael Weghorn 
AuthorDate: Tue Nov 12 16:05:54 2019 +0100
Commit: Michael Weghorn 
CommitDate: Wed Nov 13 07:27:42 2019 +0100

tdf#128717 Sync duplex value from "Properties" dialog

The value for duplex can be set in two places, the main
print dialog and the "Properties" dialog.

Therefore, update the value for duplex combobox in the main
print dialog with the value set in the PrinterController,
to take into account potential changes carried out in the
"Properties" dialog.

(Other options, like orientation already worked fine before,
as did synchronisation the other way around.)

Change-Id: Ie68f1cfbba6def82c85745e1c361e28a1513e647
Reviewed-on: https://gerrit.libreoffice.org/82528
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 079ce29ebb6f..7750baf5039d 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1873,6 +1873,7 @@ IMPL_LINK(PrintDialog, ClickHdl, weld::Button&, rButton, 
void)
 }
 
 updateOrientationBox( false );
+setupPaperSidesBox();
 
 // tdf#63905 don't use cache: page size may change
 preparePreview(false);
commit f166f0cf4f92d1d765d9ae9003d9d725ba120e54
Author: Michael Weghorn 
AuthorDate: Tue Nov 12 16:04:09 2019 +0100
Commit: Michael Weghorn 
CommitDate: Wed Nov 13 07:27:35 2019 +0100

Related tdf#128717:  Drop "" value for duplex and paper tray

Drop the artificial extra value "" for the duplex and paper tray
options in the "Properties..." dialog used in the print dialog on Linux.

Those extra values were introduced in commit
a9f8d75e6c54b40845fc198019788ff6b568aaf5
("Administration utility for Unix PS-Print Environment") in 2001.

The two corresponding comboboxes are greyed out if there are no PPD
options "Duplex" and/or "InputSlot". And if there are valid values
for these options, one of those is preselected.

I see no use in allowing to explicitly setting the value to "".
Not passing any value explicitly to CUPS will cause the default option
to be used anyway.

Having an additional option for Duplex is also inconsistent with the
(revamped) main print dialog, where that additional value is not
offered for the duplex option, i.e. the "Properties" dialog offers
more choices than the main print dialog.

Change-Id: Id9d20a061e51921e601d53d74aa8079fe3c59aca
Reviewed-on: https://gerrit.libreoffice.org/82527
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc
index c561de71c369..7e936fc711a2 100644
--- a/vcl/inc/strings.hrc
+++ b/vcl/inc/strings.hrc
@@ -117,7 +117,6 @@
 #define SV_PRINT_TOFILE_TXT  
NC_("SV_PRINT_TOFILE_TXT", "Print to File...")
 #define SV_PRINT_DEFPRT_TXT  
NC_("SV_PRINT_DEFPRT_TXT", "Default printer")
 #define SV_PRINT_QUERYFAXNUMBER_TXT  
NC_("SV_PRINT_QUERYFAXNUMBER_TXT", "Please enter the fax number")
-#define SV_PRINT_INVALID_TXT 
NC_("SV_PRINT_INVALID_TXT", "")
 #define SV_PRINT_CUSTOM_TXT  
NC_("SV_PRINT_CUSTOM_TXT", "Custom")
 
 #define SV_EDIT_WARNING_STR  
NC_("SV_EDIT_WARNING_STR", "The inserted text exceeded the maximum length of 
this text field. The text was truncated.")
diff --git a/vcl/unx/generic/print/prtsetup.cxx 
b/vcl/unx/generic/print/prtsetup.cxx
index a484de3da1b5..ad5d0fc53553 100644
--- a/vcl/unx/generic/print/prtsetup.cxx
+++ b/vcl/unx/generic/print/prtsetup.cxx
@@ -61,8 +61,6 @@ void RTSDialog::insertAllPPDValues(weld::ComboBox& rBox, 
const PPDParser* pParse
 if (nPos != -1)
 rBox.set_active(nPos);
 }
-else
-rBox.set_active_text(m_aInvalidString);
 }
 
 /*
@@ -72,7 +70,6 @@ void RTSDialog::insertAllPPDValues(weld::ComboBox& rBox, 
const PPDParser* pParse
 RTSDialog::RTSDialog(const PrinterInfo& rJobData, weld::Window* pParent)
 : GenericDialogController(pParent, "vcl/ui/printerpropertiesdialog.ui", 
"PrinterPropertiesDialog")
 , m_aJobData(rJobData)
-, m_aInvalidString(VclResId(SV_PRINT_INVALID_TXT))
 , m_bDataModified(false)
 , m_xTabControl(m_xBuilder->weld_notebook("tabcontrol"))
 , m_xOKButton(m_xBuilder->weld_button("ok"))
@@ -152,14 +149,6 @@ RTSPaperPage::RTSPaperPage(weld::Widget* pPage, RTSDialog* 
pDialog)
 m_xSlotBox->connect_changed( LINK( this, RTSPaperPage, SelectHdl ) );
 m_xCbFromSetup->connect_toggled( LINK( 

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx

2018-08-15 Thread Libreoffice Gerrit user
 vcl/inc/PhysicalFontCollection.hxx |2 +-
 vcl/inc/unx/freetype_glyphcache.hxx|2 +-
 vcl/source/font/PhysicalFontCollection.cxx |   24 +---
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |   11 +++
 4 files changed, 14 insertions(+), 25 deletions(-)

New commits:
commit 9467f10de690c622a210120e1963b2d755875a6b
Author: Noel Grandin 
AuthorDate: Mon Aug 13 14:35:52 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 15 08:40:23 2018 +0200

loplugin:useuniqueptr in FreetypeManager

Change-Id: Idf8f843f2740bc20e6b0877b62dbfc778e31acd8
Reviewed-on: https://gerrit.libreoffice.org/59018
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/unx/freetype_glyphcache.hxx 
b/vcl/inc/unx/freetype_glyphcache.hxx
index 910aa2a70ae6..57c9f02df2ad 100644
--- a/vcl/inc/unx/freetype_glyphcache.hxx
+++ b/vcl/inc/unx/freetype_glyphcache.hxx
@@ -100,7 +100,7 @@ public:
 FreetypeFont* CreateFont( const FontSelectPattern& );
 
 private:
-typedef std::unordered_map FontList;
+typedef std::unordered_map> 
FontList;
 FontListmaFontList;
 
 sal_IntPtr  mnMaxFontId;
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx 
b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 32d6f9c8d10a..c747da4dae18 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -308,7 +308,7 @@ void FreetypeManager::AddFontFile( const OString& 
rNormalizedName,
 
 FreetypeFontInfo* pFontInfo = new FreetypeFontInfo( rDevFontAttr,
 rNormalizedName, nFaceNum, nFontId);
-maFontList[ nFontId ] = pFontInfo;
+maFontList[ nFontId ].reset(pFontInfo);
 if( mnMaxFontId < nFontId )
 mnMaxFontId = nFontId;
 }
@@ -317,18 +317,13 @@ void FreetypeManager::AnnounceFonts( 
PhysicalFontCollection* pToAdd ) const
 {
 for (auto const& font : maFontList)
 {
-FreetypeFontInfo* pFreetypeFontInfo = font.second;
+FreetypeFontInfo* pFreetypeFontInfo = font.second.get();
 pFreetypeFontInfo->AnnounceFont( pToAdd );
 }
 }
 
 void FreetypeManager::ClearFontList( )
 {
-for (auto const& font : maFontList)
-{
-FreetypeFontInfo* pFreetypeFontInfo = font.second;
-delete pFreetypeFontInfo;
-}
 maFontList.clear();
 }
 
@@ -344,7 +339,7 @@ FreetypeFont* FreetypeManager::CreateFont( const 
FontSelectPattern& rFSD )
 
 sal_IntPtr nFontId = pFontFace->GetFontId();
 FontList::iterator it = maFontList.find(nFontId);
-FreetypeFontInfo* pFontInfo = it != maFontList.end() ? it->second : 
nullptr;
+FreetypeFontInfo* pFontInfo = it != maFontList.end() ? it->second.get() : 
nullptr;
 
 if (!pFontInfo)
 return nullptr;
commit 40ab9800d3d19eee59571092a9872c8fe9af4e38
Author: Noel Grandin 
AuthorDate: Mon Aug 13 14:34:15 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 15 08:40:07 2018 +0200

loplugin:useuniqueptr in PhysicalFontCollection

Change-Id: Id0a6a44848541968e9084a198366accda9c1149a
Reviewed-on: https://gerrit.libreoffice.org/59017
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/PhysicalFontCollection.hxx 
b/vcl/inc/PhysicalFontCollection.hxx
index fd944a211631..46caab87c7c7 100644
--- a/vcl/inc/PhysicalFontCollection.hxx
+++ b/vcl/inc/PhysicalFontCollection.hxx
@@ -70,7 +70,7 @@ public:
 private:
 mutable boolmbMatchData;// true if matching attributes are 
initialized
 
-typedef std::unordered_map 
PhysicalFontFamilies;
+typedef std::unordered_map> 
PhysicalFontFamilies;
 PhysicalFontFamiliesmaPhysicalFontFamilies;
 
 ImplPreMatchFontSubstitution* mpPreMatchHook;   // device specific 
prematch substitution
diff --git a/vcl/source/font/PhysicalFontCollection.cxx 
b/vcl/source/font/PhysicalFontCollection.cxx
index 25e07b3d..7c5745a3a829 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -89,12 +89,6 @@ void PhysicalFontCollection::Clear()
 mnFallbackCount = -1;
 
 // clear all entries in the device font list
-for (auto const& family : maPhysicalFontFamilies)
-{
-PhysicalFontFamily* pEntry = family.second;
-delete pEntry;
-}
-
 maPhysicalFontFamilies.clear();
 
 // match data must be recalculated too
@@ -296,7 +290,7 @@ PhysicalFontFamily* 
PhysicalFontCollection::ImplFindFontFamilyBySearchName( cons
 if( it == maPhysicalFontFamilies.end() )
 return nullptr;
 
-PhysicalFontFamily* pFoundData = (*it).second;
+PhysicalFontFamily* pFoundData = (*it).second.get();
 return pFoundData;
 }
 
@@ -311,12 +305,12 @@ PhysicalFontFamily 
*PhysicalFontCollection::FindOrCreateFontFamily( const OUStri
 PhysicalFontFamily* pFoundData = nullptr;
 
 if( it != maPhysicalFontFamilies.end() )
-pFoundData = (*it).second;
+pFoundData = 

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx

2016-11-15 Thread Caolán McNamara
 vcl/inc/unx/gtk/gtkframe.hxx  |   12 
 vcl/source/window/syswin.cxx  |4 
 vcl/unx/gtk3/gtk3gtkframe.cxx |   25 -
 3 files changed, 8 insertions(+), 33 deletions(-)

New commits:
commit 68fc92db88f17f1dc6113eafbb9e95ebf06d90d1
Author: Caolán McNamara 
Date:   Tue Nov 15 13:16:01 2016 +

use only widget_set_size_request in gtk3

and remove some bogus out of date comments

Change-Id: I589eb64016241cf2bcd425ccbaa62229f36880e8

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 9661ac8..2303e47 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -272,6 +272,9 @@ class GtkSalFrame : public SalFrame
 static gboolean signalExpose( GtkWidget*, GdkEventExpose*, gpointer );
 void askForXEmbedFocus( sal_Int32 nTimecode );
 void grabKeyboard(bool bGrab);
+void resizeWindow( long nWidth, long nHeight );
+//call gtk_window_resize
+void window_resize(long nWidth, long nHeight);
 #endif
 static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
 static gboolean signalMap( GtkWidget*, GdkEvent*, gpointer );
@@ -321,16 +324,9 @@ class GtkSalFrame : public SalFrame
 return bool(m_nStyle & nMask);
 }
 
-//call gtk_window_resize if the current size differs and
-//block Paints until Configure is received and the size
-//is valid again
-void window_resize(long nWidth, long nHeight);
-//call gtk_widget_set_size_request if the current size request differs and
-//block Paints until Configure is received and the size
-//is valid again
+//call gtk_widget_set_size_request
 void widget_set_size_request(long nWidth, long nHeight);
 
-void resizeWindow( long nWidth, long nHeight );
 void moveWindow( long nX, long nY );
 
 Size calcDefaultSize();
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index ad4adf4..5780340 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -894,25 +894,9 @@ void GtkSalFrame::moveWindow( long nX, long nY )
 
 void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight)
 {
-gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight 
);
-}
-
-void GtkSalFrame::window_resize(long nWidth, long nHeight)
-{
 m_nWidthRequest = nWidth;
 m_nHeightRequest = nHeight;
-widget_set_size_request(nWidth, nHeight);
-gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
-}
-
-void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
-{
-if( isChild( false ) )
-{
-widget_set_size_request(nWidth, nHeight);
-}
-else if( ! isChild( true, false ) )
-window_resize(nWidth, nHeight);
+gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight 
);
 }
 
 static void
@@ -1604,10 +1588,8 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long 
nWidth, long nHeight, sal_u
 {
 m_bDefaultSize = false;
 
-if( isChild( false ) )
+if (!(m_nState & GDK_WINDOW_STATE_MAXIMIZED))
 widget_set_size_request(nWidth, nHeight);
-else if( ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) )
-window_resize(nWidth, nHeight);
 
 setMinMaxSize();
 }
@@ -1685,7 +1667,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* 
pState )
 (pState->mnState & WindowStateState::Maximized) &&
 (pState->mnMask & nMaxGeometryMask) == nMaxGeometryMask )
 {
-resizeWindow( pState->mnWidth, pState->mnHeight );
+widget_set_size_request( pState->mnWidth, pState->mnHeight );
 moveWindow( pState->mnX, pState->mnY );
 m_bDefaultPos = m_bDefaultSize = false;
 
@@ -1895,7 +1877,7 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, 
SetType eType, Rectangle *
 // temporarily re-sizeable
 if( !(m_nStyle & SalFrameStyleFlags::SIZEABLE) )
 gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
-window_resize(nWidth, nHeight);
+widget_set_size_request(nWidth, nHeight);
 }
 
 gtk_window_move(GTK_WINDOW(m_pWindow), nX, nY);
commit 1aeff41c4a6b16a2ec69faf4a0bee301bd609101
Author: Caolán McNamara 
Date:   Tue Nov 15 13:04:16 2016 +

Resolves: tdf#102957 revert SetMinOutputSizePixel workaround

of

commit afeddaf7e0d11ad9b1df0c80bcc3f50caa87e21a
Author: Caolán McNamara 
Date:   Wed Dec 16 10:46:10 2015 +

Related: rhbz#1281906 set a min size on un-resizeable non-layout dialogs

and setting a size-request seems to do the right thing for me now under 
wayland
so the original problem can be solved that way

Change-Id: Ie2dd71c5a32131a60729448f0665d5cae2a83692

diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index f7732910..e7e6683 100644
--- a/vcl/source/window/syswin.cxx
+++ 

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx

2016-05-22 Thread Noel Grandin
 vcl/inc/unx/gtk/gtkframe.hxx |5 -
 vcl/source/filter/wmf/winmtf.cxx |4 ++--
 vcl/source/filter/wmf/winmtf.hxx |   13 ++---
 vcl/unx/gtk/gtksalframe.cxx  |   28 +++-
 vcl/unx/gtk3/gtk3gtkframe.cxx|   28 +++-
 5 files changed, 34 insertions(+), 44 deletions(-)

New commits:
commit dfc6b7506738465b14c6bcce63ce5eb7266c969a
Author: Noel Grandin 
Date:   Fri May 20 15:20:42 2016 +0200

Convert WinMtfFillStyleType to scoped enum

Change-Id: Ifcbcac1883285d175e1b72e99f300afad2f4d092
Reviewed-on: https://gerrit.libreoffice.org/25200
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index ac6fac9..2228bbc 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -912,7 +912,7 @@ void WinMtfOutput::UpdateFillStyle()
 if (!( maLatestFillStyle == maFillStyle ) )
 {
 maLatestFillStyle = maFillStyle;
-if (maFillStyle.aType == FillStyleSolid)
+if (maFillStyle.aType == WinMtfFillStyleType::Solid)
 mpGDIMetaFile->AddAction( new MetaFillColorAction( 
maFillStyle.aFillColor, !maFillStyle.bTransparent ) );
 }
 }
@@ -1211,7 +1211,7 @@ void WinMtfOutput::DrawPolygon( tools::Polygon& rPolygon, 
bool bRecordPath )
 {
 UpdateLineStyle();
 
-if (maLatestFillStyle.aType != FillStylePattern)
+if (maLatestFillStyle.aType != WinMtfFillStyleType::Pattern)
 mpGDIMetaFile->AddAction( new MetaPolygonAction( rPolygon 
) );
 else {
 SvtGraphicFill aFill = SvtGraphicFill( tools::PolyPolygon( 
rPolygon ),
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index 3f4182e..cff2763 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -299,11 +299,10 @@ struct WinMtfFontStyle : GDIObj
 };
 
 
-typedef enum
+enum class WinMtfFillStyleType
 {
-FillStyleSolid,
-FillStylePattern
-} WinMtfFillStyleType;
+Solid, Pattern
+};
 
 struct WinMtfFillStyle : GDIObj
 {
@@ -315,18 +314,18 @@ struct WinMtfFillStyle : GDIObj
 WinMtfFillStyle()
 : aFillColor(Color(COL_BLACK))
 , bTransparent(false)
-, aType(FillStyleSolid)
+, aType(WinMtfFillStyleType::Solid)
 {}
 
 WinMtfFillStyle(const Color& rColor, bool bTrans = false)
 : aFillColor(rColor)
 , bTransparent(bTrans)
-, aType(FillStyleSolid)
+, aType(WinMtfFillStyleType::Solid)
 {}
 
 explicit WinMtfFillStyle(Bitmap& rBmp)
 : bTransparent(false)
-, aType(FillStylePattern)
+, aType(WinMtfFillStyleType::Pattern)
 , aBmp(rBmp)
 {}
 
commit a0ac522f6b9850c478c28bb54cafe82fed95a389
Author: Noel Grandin 
Date:   Fri May 20 15:17:41 2016 +0200

Convert SetType to scoped enum

Change-Id: I1f724340a990ce8a811fa84e1f5fc54fad54ae81
Reviewed-on: https://gerrit.libreoffice.org/25198
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 7c0803b..14a9818 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -342,7 +342,10 @@ class GtkSalFrame : public SalFrame
 void TriggerPaintEvent();
 
 void updateWMClass();
-void SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSize = 
nullptr );
+
+enum class SetType { RetainSize, Fullscreen, UnFullscreen };
+
+void SetScreen( unsigned int nNewScreen, SetType eType, Rectangle *pSize = 
nullptr );
 
 public:
 #if GTK_CHECK_VERSION(3,0,0)
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 83e8836..0c6e315 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -1935,18 +1935,12 @@ bool GtkSalFrame::GetWindowState( SalFrameState* pState 
)
 return true;
 }
 
-typedef enum {
-SET_RETAIN_SIZE,
-SET_FULLSCREEN,
-SET_UN_FULLSCREEN
-} SetType;
-
-void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle 
*pSize )
+void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, Rectangle 
*pSize )
 {
 if( !m_pWindow )
 return;
 
-if (maGeometry.nDisplayScreenNumber == nNewScreen && eType == 
SET_RETAIN_SIZE)
+if (maGeometry.nDisplayScreenNumber == nNewScreen && eType == 
SetType::RetainSize)
 return;
 
 GdkScreen *pScreen = nullptr;
@@ -2011,7 +2005,7 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, int 
eType, Rectangle *pSiz
 if( bVisible )
 Show( false );
 
-if( eType == SET_FULLSCREEN )
+if( eType == SetType::Fullscreen )
 {
 maGeometry.nX = aNewMonitor.x;
 maGeometry.nY = aNewMonitor.y;
@@ 

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx

2016-02-12 Thread Caolán McNamara
 vcl/inc/unx/gtk/gtkgdi.hxx|2 +
 vcl/source/control/fixedhyper.cxx |5 ++--
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |   35 +++---
 3 files changed, 23 insertions(+), 19 deletions(-)

New commits:
commit 6603564716694a1211e9a451bf868b2fc8f29460
Author: Caolán McNamara 
Date:   Fri Feb 12 11:36:16 2016 +

gtk3: we don't render whatever a CTRL_LISTNET is

Change-Id: I21a64250182b4630fa41583d7536081adf441ec5

diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 1cda456..675b098 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -1316,6 +1316,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType 
nType, ControlPart nPart, co
 }
 break;
 case CTRL_LISTNET:
+return true;
 break;
 case CTRL_TAB_PANE:
 context = mpNotebookStyle;
commit 06e8c58acb6ba667f8fd8c5587a3b3037324971a
Author: Caolán McNamara 
Date:   Fri Feb 12 11:32:53 2016 +

Related: rhbz#1287593 subissue 6, get suitable hyperlink colors for dark 
theme

Change-Id: Ieb5ed52fa8a9c26b3e839388a58cff295166eed9

diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 13ac198..2bb6029 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -36,6 +36,7 @@
 enum class GtkControlPart
 {
 Button,
+LinkButton,
 CheckButton,
 CheckButtonCheck,
 RadioButton,
@@ -100,6 +101,7 @@ public:
 private:
 GtkWidget   *mpWindow;
 static GtkStyleContext *mpButtonStyle;
+static GtkStyleContext *mpLinkButtonStyle;
 static GtkStyleContext *mpEntryStyle;
 static GtkStyleContext *mpTextViewStyle;
 static GtkStyleContext *mpVScrollbarStyle;
diff --git a/vcl/source/control/fixedhyper.cxx 
b/vcl/source/control/fixedhyper.cxx
index da53f9a..7f940dd2 100644
--- a/vcl/source/control/fixedhyper.cxx
+++ b/vcl/source/control/fixedhyper.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 
 FixedHyperlink::FixedHyperlink(vcl::Window* pParent, WinBits nWinStyle)
 : FixedText(pParent, nWinStyle)
@@ -35,8 +36,8 @@ void FixedHyperlink::Initialize()
 // to underline
 aFont.SetUnderline( LINESTYLE_SINGLE );
 SetControlFont( aFont );
-// changes the color to light blue
-SetControlForeground( Color( COL_LIGHTBLUE ) );
+// changes the color to link color
+SetControlForeground( 
Application::GetSettings().GetStyleSettings().GetLinkColor() );
 // calculates text len
 m_nTextLen = GetCtrlTextWidth( GetText() );
 }
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 33117b0..1cda456 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -22,6 +22,7 @@
 #include 
 
 GtkStyleContext* GtkSalGraphics::mpButtonStyle = nullptr;
+GtkStyleContext* GtkSalGraphics::mpLinkButtonStyle = nullptr;
 GtkStyleContext* GtkSalGraphics::mpEntryStyle = nullptr;
 GtkStyleContext* GtkSalGraphics::mpTextViewStyle = nullptr;
 GtkStyleContext* GtkSalGraphics::mpVScrollbarStyle = nullptr;
@@ -821,6 +822,15 @@ static GtkStyleContext* createStyleContext(GtkControlPart 
ePart, GtkStyleContext
 gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_BUTTON);
 #endif
 break;
+case GtkControlPart::LinkButton:
+gtk_widget_path_append_type(path, GTK_TYPE_BUTTON);
+#if GTK_CHECK_VERSION(3, 19, 2)
+gtk_widget_path_iter_set_object_name(path, -1, "button");
+#else
+gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_BUTTON);
+#endif
+gtk_widget_path_iter_add_class(path, -1, "link");
+break;
 case GtkControlPart::CheckButton:
 gtk_widget_path_append_type(path, GTK_TYPE_CHECK_BUTTON);
 #if GTK_CHECK_VERSION(3, 19, 2)
@@ -1989,23 +1999,12 @@ void GtkSalGraphics::updateSettings( AllSettings& 
rSettings )
 aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
 
 // hyperlink colors
-GdkColor *link_color = nullptr;
-gtk_style_context_get_style(pStyle,
- "link-color", _color,
- nullptr);
-if (link_color) {
-aStyleSet.SetLinkColor(getColorFromColor(*link_color));
-gdk_color_free(link_color);
-}
-
-link_color = nullptr;
-gtk_style_context_get_style(pStyle,
-"visited-link-color", _color,
-nullptr);
-if (link_color) {
-aStyleSet.SetVisitedLinkColor(getColorFromColor(*link_color));
-gdk_color_free(link_color);
-}
+gtk_style_context_set_state(mpLinkButtonStyle, GTK_STATE_FLAG_LINK);
+gtk_style_context_get_color(mpLinkButtonStyle, 
gtk_style_context_get_state(mpLinkButtonStyle), _color);
+

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx

2015-05-13 Thread Caolán McNamara
 vcl/inc/unx/gtk/gtkgdi.hxx|9 -
 vcl/source/control/ilstbox.cxx|2 
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |  182 +++---
 3 files changed, 114 insertions(+), 79 deletions(-)

New commits:
commit 7343e171256f16e86b3c43aca6412c738c89c3d4
Author: Caolán McNamara caol...@redhat.com
Date:   Tue May 12 21:06:48 2015 +0100

gtk3: stop painting the active listboxes blue

gtk3 equivalents are comboboxes without entries and
those don't do this

Change-Id: I71efe2c11a1d604e6c15927844f5a25b78771e62

diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index bd1935c..0961df1 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2716,7 +2716,7 @@ void ImplWin::ImplDraw( bool bLayout )
 
 if( IsEnabled() )
 {
-if( HasFocus() )
+if (HasFocus()  
!ImplGetSVData()-maNWFData.mbDDListBoxNoTextArea)
 {
 SetTextColor( rStyleSettings.GetHighlightTextColor() );
 SetFillColor( rStyleSettings.GetHighlightColor() );
commit 5db6da7c5d27c5b8be59fb9a4599d5c95d7f1bd7
Author: Caolán McNamara caol...@redhat.com
Date:   Tue May 12 17:37:58 2015 +0100

gtk3: get comboboxes and listboxes rendering right again

and also get roll-over working for listboxes, here
its actually to *not* support PART_BUTTON_DOWN that does
that, which is weird.

Change-Id: I0fc1152a3ee49164f6b5ecca6933730271c6da5c

diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 68c6cf7..bde44ab 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -77,7 +77,10 @@ private:
 static GtkStyleContext *mpMenuItemStyle;
 static GtkStyleContext *mpSpinStyle;
 static GtkStyleContext *mpComboboxStyle;
+static GtkStyleContext *mpComboboxEntryStyle;
+static GtkStyleContext *mpComboboxButtonStyle;
 static GtkStyleContext *mpListboxStyle;
+static GtkStyleContext *mpListboxButtonStyle;
 static GtkStyleContext *mpNoteBookStyle;
 
 static Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle 
aAreaRect );
@@ -101,13 +104,13 @@ private:
  const Rectangle rControlRectangle,
  ControlType nType,
  ControlPart nPart,
- const ImplControlValue aValue );
-static void PaintCombobox( GtkStyleContext *context,
+ const ImplControlValue aValue);
+static void PaintCombobox(GtkStateFlags flags,
 cairo_t *cr,
 const Rectangle rControlRectangle,
 ControlType nType,
 ControlPart nPart,
-const ImplControlValue aValue );
+const ImplControlValue aValue);
 static void PaintCheckOrRadio(GtkStyleContext *context,
cairo_t *cr,
const Rectangle rControlRectangle,
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 906d3b2..2aad70e 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -32,7 +32,10 @@ GtkStyleContext* GtkSalGraphics::mpMenuStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpMenuItemStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpSpinStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpComboboxStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpComboboxEntryStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpComboboxButtonStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpListboxStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpListboxButtonStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpNoteBookStyle = NULL;
 
 bool GtkSalGraphics::style_loaded = false;
@@ -78,37 +81,6 @@ enum {
 RENDER_EXTENSION = 11,
 };
 
-static void PrepareComboboxStyle( GtkStyleContext *context,
-  gboolean forEntry)
-{
-GtkWidgetPath *path, *siblingsPath;
-
-path = gtk_widget_path_new();
-siblingsPath = gtk_widget_path_new();
-gtk_widget_path_append_type(path, GTK_TYPE_COMBO_BOX);
-gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_COMBOBOX_ENTRY);
-
-gtk_widget_path_append_type(siblingsPath, GTK_TYPE_ENTRY);
-gtk_widget_path_append_type(siblingsPath, GTK_TYPE_BUTTON);
-gtk_widget_path_iter_add_class(siblingsPath, 0, GTK_STYLE_CLASS_ENTRY);
-gtk_widget_path_iter_add_class(siblingsPath, 1, GTK_STYLE_CLASS_BUTTON);
-
-if (forEntry)
-{
-gtk_widget_path_append_with_siblings(path, siblingsPath, 1);
-gtk_widget_path_append_with_siblings(path, siblingsPath, 0);
-}
-else
-{
-gtk_widget_path_append_with_siblings(path, siblingsPath, 0);
-gtk_widget_path_append_with_siblings(path, siblingsPath, 1);
-}
-
-

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source vcl/unx

2015-01-23 Thread Chris Sherlock
 vcl/inc/cairotextrender.hxx  |2 
 vcl/source/opengl/OpenGLHelper.cxx   |6 ++
 vcl/unx/generic/gdi/cairotextrender.cxx  |2 
 vcl/unx/generic/gdi/openglx11cairotextrender.cxx |   53 ---
 vcl/unx/generic/gdi/openglx11cairotextrender.hxx |2 
 vcl/unx/generic/gdi/x11cairotextrender.cxx   |3 -
 vcl/unx/generic/gdi/x11cairotextrender.hxx   |3 -
 7 files changed, 60 insertions(+), 11 deletions(-)

New commits:
commit fa4327421ebaaf562d8689b454117b101c5eee24
Author: Chris Sherlock chris.sherloc...@gmail.com
Date:   Sat Jan 24 14:26:25 2015 +1100

vcl: OpenGLHelper::isVCLOpenGLEnabled() returns false when console only

Change-Id: I7bcda46c73b958637073f8ec95d093385a81df3f

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index 99ef093..af1d8e7 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -18,6 +18,7 @@
 #include boost/scoped_array.hpp
 #include vcl/pngwrite.hxx
 #include vcl/graph.hxx
+#include vcl/svapp.hxx
 #include officecfg/Office/Common.hxx
 
 #include vector
@@ -408,6 +409,11 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
 static bool bSet = false;
 static bool bEnable = false;
 static bool bForceOpenGL = false;
+
+// If we are a console app, then we don't use OpenGL
+if ( Application::IsConsoleOnly() )
+return false;
+
 if (bSet)
 {
 return bForceOpenGL || bEnable;
commit 35131df0ff833423809ea38621002322cf2d75b2
Author: Chris Sherlock chris.sherloc...@gmail.com
Date:   Mon Jan 19 16:04:24 2015 +1100

vcl: Reduce OpenGLX11CairoTextRender surface area to size of text bounds

With this patch I get the text boundary and use it to reduce the size
of the surface to this area. However, this is mainly needed for
OpenGLX11CairoTextRender, which creates a surface image and uses this
for OpenGL rendering.

Change-Id: Icffc19bed89aaa2ff84ae845d274258a6fca27da

diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx
index d59d75c..6eb887d 100644
--- a/vcl/inc/cairotextrender.hxx
+++ b/vcl/inc/cairotextrender.hxx
@@ -80,7 +80,7 @@ class CairoTextRender : public TextRenderImpl
 
 protected:
 virtual GlyphCache getPlatformGlyphCache() = 0;
-virtual cairo_surface_t*getCairoSurface() = 0;
+virtual cairo_surface_t*getCairoSurface( const ServerFontLayout 
rLayout ) = 0;
 virtual voidgetSurfaceOffset(double nDX, double nDY) = 0;
 virtual voiddrawSurface(cairo_t* cr) = 0;
 
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx 
b/vcl/unx/generic/gdi/cairotextrender.cxx
index 7b0438e..1ad5936 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -204,7 +204,7 @@ void CairoTextRender::DrawServerFontLayout( const 
ServerFontLayout rLayout )
 if (cairo_glyphs.empty())
 return;
 
-cairo_surface_t *surface = getCairoSurface();
+cairo_surface_t *surface = getCairoSurface( rLayout );
 
 DBG_ASSERT( surface!=NULL, no cairo surface for text );
 if( !surface )
diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx 
b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
index 64bf196..67024bf 100644
--- a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
@@ -20,23 +20,64 @@ OpenGLX11CairoTextRender::OpenGLX11CairoTextRender(bool 
bPrinter, X11SalGraphics
 {
 }
 
-cairo_surface_t* OpenGLX11CairoTextRender::getCairoSurface()
+cairo_surface_t* OpenGLX11CairoTextRender::getCairoSurface( const 
ServerFontLayout rLayout )
 {
 // static size_t id = 0;
 // OString aFileName = OString(/tmp/libo_logs/text_rendering) + 
OString::number(id++) + OString(.svg);
 // cairo_surface_t* surface = cairo_svg_surface_create(aFileName.getStr(), 
GetWidth(), GetHeight());
 cairo_surface_t* surface = NULL;
+Rectangle aTextBoundRect;
 OpenGLSalGraphicsImpl *pImpl = dynamic_cast OpenGLSalGraphicsImpl* 
(mrParent.GetImpl());
-if( pImpl )
+
+if (pImpl)
 {
 Rectangle aClipRect = pImpl-getClipRegion().GetBoundRect();
-if( aClipRect.GetWidth() == 0 || aClipRect.GetHeight() == 0 )
+
+// no clipping area, we need to take the whole area
+if ( aClipRect.IsEmpty() )
+{
+aClipRect.setWidth(GetWidth());
+aClipRect.setHeight(GetHeight());
+}
+
+if (!rLayout.GetOrientation() )
+{
+// GetBoundRect can fail!
+if ( rLayout.GetBoundRect(mrParent, aTextBoundRect) )
+{
+// we need to take into account SalLayout's drawing offset
+int nOffsetX = rLayout.DrawOffset().X() - 
rLayout.DrawBase().X();
+int nOffsetY = rLayout.DrawOffset().Y() - 
rLayout.DrawBase().Y();
+
+aTextBoundRect.Left() += nOffsetX;
+