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

2023-08-28 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |2 ++
 vcl/unx/gtk3/gtkinst.cxx  |3 +++
 2 files changed, 5 insertions(+)

New commits:
commit df3b95a39472e18ea8acdaae447b7176e37a9256
Author: Caolán McNamara 
AuthorDate: Mon Aug 28 09:11:15 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 28 12:21:40 2023 +0200

Related: tdf#144906 unset g_DragSource if drag end callback never called

a scenario I can reproduce with alt+f4 while dragging from the
navigator

Change-Id: I7123602e036fbe15e0ae8f9a7e1d5fc7483dc6c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156182
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 91c96ed4986a..780c6baae79e 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5126,6 +5126,8 @@ SalInstanceTreeView::~SalInstanceTreeView()
 
static_cast(*m_xTreeView).SetStartDragHdl(Link());
 
static_cast(*m_xTreeView).SetModelChangedHdl(Link());
 }
+if (g_DragSource == this)
+g_DragSource = nullptr;
 m_xTreeView->SetPopupMenuHdl(Link());
 m_xTreeView->SetExpandingHdl(Link());
 m_xTreeView->SetDoubleClickHdl(Link());
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 141039dfb79c..087f2ef186ec 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -16768,6 +16768,9 @@ public:
 g_signal_handler_disconnect(m_pTreeView, m_nRowActivatedSignalId);
 g_signal_handler_disconnect(gtk_tree_view_get_selection(m_pTreeView), 
m_nChangedSignalId);
 
+if (g_DragSource == this)
+g_DragSource = nullptr;
+
 GValue value = G_VALUE_INIT;
 g_value_init(, G_TYPE_POINTER);
 g_value_set_pointer(, static_cast(nullptr));


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

2023-02-26 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx   |   38 ++--
 vcl/unx/generic/fontmanager/fontmanager.cxx |   33 
 2 files changed, 31 insertions(+), 40 deletions(-)

New commits:
commit 03f58d6af52bab05545833980cca835a3df0949a
Author: Caolán McNamara 
AuthorDate: Sun Feb 26 16:03:37 2023 +
Commit: Caolán McNamara 
CommitDate: Sun Feb 26 23:29:17 2023 +

cid#1521198 Untrusted loop bound

move sanity check inside CountTTCFonts so it applies
to the fd smuggle in via filename mechanism

Change-Id: Id2fee5801d71720747a8736859681e7c9a324bc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147740
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 6644946699a4..549507121962 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1073,8 +1073,6 @@ static void GetNames(AbstractTrueTypeFont *t)
 
 int CountTTCFonts(const char* fname)
 {
-int nFonts = 0;
-sal_uInt8 buffer[12];
 FILE* fd;
 #ifdef LINUX
 int nFD;
@@ -1088,13 +1086,39 @@ int CountTTCFonts(const char* fname)
 else
 #endif
 fd = fopen(fname, "rb");
-if( fd ) {
-if (fread(buffer, 1, 12, fd) == 12) {
-if(GetUInt32(buffer, 0) == T_ttcf )
-nFonts = GetUInt32(buffer, 8);
+
+if (!fd)
+return 0;
+
+int nFonts = 0;
+sal_uInt8 buffer[12];
+if (fread(buffer, 1, 12, fd) == 12) {
+if(GetUInt32(buffer, 0) == T_ttcf )
+nFonts = GetUInt32(buffer, 8);
+}
+
+if (nFonts > 0)
+{
+fseek(fd, 0, SEEK_END);
+sal_uInt64 fileSize = ftell(fd);
+
+//Feel free to calc the exact max possible number of fonts a file
+//could contain given its physical size. But this will clamp it to
+//a sane starting point
+//http://processingjs.nihongoresources.com/the_smallest_font/
+//https://github.com/grzegorzrolek/null-ttf
+const int nMaxFontsPossible = fileSize / 528;
+if (nFonts > nMaxFontsPossible)
+{
+SAL_WARN("vcl.fonts", "font file " << fname <<" claims to have "
+ << nFonts << " fonts, but only "
+ << nMaxFontsPossible << " are possible");
+nFonts = nMaxFontsPossible;
 }
-fclose(fd);
 }
+
+fclose(fd);
+
 return nFonts;
 }
 
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx 
b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 0d48a692e97e..e9e2907091f9 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -179,14 +179,12 @@ std::vector 
PrintFontManager::analyzeFontFile( int
 OString aFullPath = aDir + "/" + rFontFile;
 
 bool bSupported;
-bool bHack = false;
 int nFD;
 int n;
 if (sscanf(aFullPath.getStr(), "/:FD:/%d%n", , ) == 1 && 
aFullPath.getStr()[n] == '\0')
 {
 // Hack, pathname that actually means we will use a pre-opened file 
descriptor
 bSupported = true;
-bHack = true;
 }
 else
 {
@@ -220,37 +218,6 @@ std::vector 
PrintFontManager::analyzeFontFile( int
 {
 SAL_INFO("vcl.fonts", "ttc: " << aFullPath << " contains " << 
nLength << " fonts");
 
-if (!bHack)
-{
-sal_uInt64 fileSize = 0;
-
-OUString aURL;
-if 
(osl::File::getFileURLFromSystemPath(OStringToOUString(aFullPath, 
osl_getThreadTextEncoding()),
-aURL) == osl::File::E_None)
-{
-osl::File aFile(aURL);
-if (aFile.open(osl_File_OpenFlag_Read | 
osl_File_OpenFlag_NoLock) == osl::File::E_None)
-{
-osl::DirectoryItem aItem;
-if (osl::DirectoryItem::get(aURL, aItem) == 
osl::File::E_None)
-{
-osl::FileStatus aFileStatus( 
osl_FileStatus_Mask_FileSize );
-if (aItem.getFileStatus(aFileStatus) == 
osl::File::E_None)
-fileSize = aFileStatus.getFileSize();
-}
-}
-}
-
-//Feel free to calc the exact max possible number of fonts a 
file
-//could contain given its physical size. But this will clamp 
it to
-//a sane starting point
-//http://processingjs.nihongoresources.com/the_smallest_font/
-//https://github.com/grzegorzrolek/null-ttf
-const int nMaxFontsPossible = fileSize / 528;
-if (nLength > nMaxFontsPossible)
-nLength = nMaxFontsPossible;
-}
-
 for( int i = 0; i < nLength; i++ )
 {
 PrintFont aFont;


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

2023-01-02 Thread Ilhan Yesil (via logerrit)
 vcl/source/control/imp_listbox.cxx|8 ++--
 vcl/source/control/listbox.cxx|   14 +++---
 vcl/unx/gtk3/salnativewidgets-gtk.cxx |   20 +++-
 3 files changed, 24 insertions(+), 18 deletions(-)

New commits:
commit ff7e00e12ff80bd708f31a1d886d000907ceb31a
Author: Ilhan Yesil 
AuthorDate: Mon Mar 21 13:27:52 2022 +0100
Commit: Michael Weghorn 
CommitDate: Tue Jan 3 07:03:55 2023 +

tdf#148109 Paint background color in listbox

The combobox described in 148109 is indeed a listbox.
If drop down list is not open and only the selected item
is shown without having the focus, the background color
will be paint either it's defined as native control
or not.

Change-Id: I210916fbe07f74aaa5835bf2c88e764b010c6d61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131904
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/control/imp_listbox.cxx 
b/vcl/source/control/imp_listbox.cxx
index 531244925062..75bc1fd622e2 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -2603,6 +2603,10 @@ void ImplWin::ImplDraw(vcl::RenderContext& 
rRenderContext, bool bLayout)
 if( bMouseOver )
 nState |= ControlState::ROLLOVER;
 
+Color aBackgroundColor = COL_AUTO;
+if (IsControlBackground())
+aBackgroundColor = GetControlBackground();
+
 // if parent has no border, then nobody has drawn the background
 // since no border window exists. so draw it here.
 WinBits nParentStyle = pWin->GetStyle();
@@ -2610,11 +2614,11 @@ void ImplWin::ImplDraw(vcl::RenderContext& 
rRenderContext, bool bLayout)
 {
 tools::Rectangle aParentRect( Point( 0, 0 ), 
pWin->GetSizePixel() );
 pWin->GetOutDev()->DrawNativeControl( ControlType::Listbox, 
ControlPart::Entire, aParentRect,
- nState, aControlValue, OUString() );
+ nState, aControlValue, OUString(), 
aBackgroundColor);
 }
 
 bNativeOK = rRenderContext.DrawNativeControl(ControlType::Listbox, 
ControlPart::Entire, aCtrlRegion,
- nState, 
aControlValue, OUString());
+ nState, 
aControlValue, OUString(), aBackgroundColor);
 }
 
 if (bIsEnabled)
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index e463b2ff958c..ce3cbba69aec 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -771,17 +771,9 @@ void ListBox::StateChanged( StateChangedType nType )
 mpImplLB->SetControlBackground( GetControlBackground() );
 if ( mpImplWin )
 {
-if ( mpImplWin->IsNativeControlSupported(ControlType::Listbox, 
ControlPart::Entire) )
-{
-// Transparent background
-mpImplWin->SetBackground();
-mpImplWin->SetControlBackground();
-}
-else
-{
-mpImplWin->SetBackground( 
mpImplLB->GetMainWindow()->GetControlBackground() );
-mpImplWin->SetControlBackground( 
mpImplLB->GetMainWindow()->GetControlBackground() );
-}
+
+mpImplWin->SetBackground( GetControlBackground() );
+mpImplWin->SetControlBackground( GetControlBackground() );
 mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
 mpImplWin->Invalidate();
 }
diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
index 6fc1be3f8257..f55b45a8b92b 100644
--- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
@@ -1005,9 +1005,8 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, 
cairo_t *cr,
 else
 {
 render_common(mpListboxStyle, cr, aRect, flags);
-render_common(mpListboxBoxStyle, cr, aRect, flags);
-
 render_common(mpListboxButtonStyle, cr, aRect, flags);
+render_common(mpListboxBoxStyle, cr, aRect, flags);
 
 gtk_render_arrow(mpListboxButtonArrowStyle, cr,
  G_PI,
@@ -1882,13 +1881,24 @@ bool GtkSalGraphics::drawNativeControl( ControlType 
nType, ControlPart nPart, co
 case RenderType::Combobox:
 if (pBgCssProvider)
 {
-gtk_style_context_add_provider(mpComboboxEntryStyle, 
GTK_STYLE_PROVIDER(pBgCssProvider),
-   
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+if (nType == ControlType::Combobox)
+{
+gtk_style_context_add_provider(mpComboboxEntryStyle, 
GTK_STYLE_PROVIDER(pBgCssProvider),
+   

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

2022-06-03 Thread Noel Grandin (via logerrit)
 vcl/source/control/field.cxx|   10 ++
 vcl/source/filter/ipdf/pdfdocument.cxx  |9 +
 vcl/source/gdi/mtfxmldump.cxx   |2 +-
 vcl/source/gdi/pdfwriter_impl.cxx   |   27 +--
 vcl/source/treelist/imap2.cxx   |   19 ++-
 vcl/source/window/window.cxx|4 ++--
 vcl/unx/generic/fontmanager/fontconfig.cxx  |2 +-
 vcl/unx/generic/fontmanager/fontmanager.cxx |   10 +-
 vcl/unx/generic/print/psputil.cxx   |2 +-
 vcl/unx/generic/printer/jobdata.cxx |   27 ++-
 vcl/unx/generic/printer/ppdparser.cxx   |2 +-
 vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx   |2 +-
 12 files changed, 64 insertions(+), 52 deletions(-)

New commits:
commit 4f4e3f3aae0b733283b549fdde586d8409b0c552
Author: Noel Grandin 
AuthorDate: Fri Jun 3 08:33:49 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Jun 3 10:02:42 2022 +0200

elide some makeStringAndClear() class

when we are passing the result to a string_view, it is pointless.

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

diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 0e0093714f5a..90aef01f115f 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -23,6 +23,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -307,9 +308,10 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& 
rValue,
 // Convert fractional strings
 if (bFrac) {
 // Convert to fraction
-sal_Int64 nWholeNum = aStr1.makeStringAndClear().toInt64();
-sal_Int64 nNum = aStrNum.makeStringAndClear().toInt64();
-sal_Int64 nDenom = aStrDenom.makeStringAndClear().toInt64();
+sal_Int64 nWholeNum = o3tl::toInt64(aStr1);
+aStr1.setLength(0);
+sal_Int64 nNum = o3tl::toInt64(aStrNum);
+sal_Int64 nDenom = o3tl::toInt64(aStrDenom);
 if (nDenom == 0) return false; // Division by zero
 double nFrac2Dec = nWholeNum + static_cast(nNum)/nDenom; // 
Convert to double for floating point precision
 OUStringBuffer aStrFrac;
@@ -336,7 +338,7 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& 
rValue,
 if (aStr2.getLength() < nDecDigits)
 string::padToLength(aStr2, nDecDigits, '0');
 
-aStr  = aStr1.makeStringAndClear() + aStr2.makeStringAndClear();
+aStr = aStr1 + aStr2;
 
 // check range
 nValue = aStr.toInt64();
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx 
b/vcl/source/filter/ipdf/pdfdocument.cxx
index 3a65d06a1540..493826e38f8f 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -139,7 +139,7 @@ sal_Int32 PDFDocument::WriteSignatureObject(const OUString& 
rDescription, bool b
 // Reserve space for the PKCS#7 object.
 OStringBuffer aContentFiller(MAX_SIGNATURE_CONTENT_LENGTH);
 comphelper::string::padToLength(aContentFiller, 
MAX_SIGNATURE_CONTENT_LENGTH, '0');
-aSigBuffer.append(aContentFiller.makeStringAndClear());
+aSigBuffer.append(aContentFiller);
 aSigBuffer.append(">\n/Type/Sig/SubFilter");
 if (bAdES)
 aSigBuffer.append("/ETSI.CAdES.detached");
@@ -164,7 +164,7 @@ sal_Int32 PDFDocument::WriteSignatureObject(const OUString& 
rDescription, bool b
 // should be enough.
 OStringBuffer aByteRangeFiller;
 comphelper::string::padToLength(aByteRangeFiller, 100, ' ');
-aSigBuffer.append(aByteRangeFiller.makeStringAndClear());
+aSigBuffer.append(aByteRangeFiller);
 // Finish the Sig obj.
 aSigBuffer.append(" /Filter/Adobe.PPKMS");
 
@@ -269,7 +269,7 @@ sal_Int32 
PDFDocument::WriteAppearanceObject(tools::Rectangle& rSignatureRectang
 assert(pPage && "aContentStreams is only filled if there was a pPage");
 OStringBuffer aBuffer;
 aCopier.copyPageResources(pPage, aBuffer);
-aEditBuffer.WriteOString(aBuffer.makeStringAndClear());
+aEditBuffer.WriteOString(aBuffer);
 }
 
 aEditBuffer.WriteCharPtr("/BBox[0 0 ");
@@ -2138,7 +2138,8 @@ bool PDFNumberElement::Read(SvStream& rStream)
 {
 rStream.SeekRel(-1);
 m_nLength = rStream.Tell() - m_nOffset;
-m_fValue = aBuf.makeStringAndClear().toDouble();
+m_fValue = o3tl::toDouble(aBuf);
+aBuf.setLength(0);
 SAL_INFO("vcl.filter", "PDFNumberElement::Read: m_fValue is '" << 
m_fValue << "'");
 return true;
 }
diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx
index 26e1afd7a6c4..2dc7e7b9d3e1 100644
--- a/vcl/source/gdi/mtfxmldump.cxx
+++ b/vcl/source/gdi/mtfxmldump.cxx
@@ -818,7 +818,7 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& 
rMetaFile, tools::XmlWriter& r
   

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

2022-01-27 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   23 +++
 vcl/unx/gtk3/gtkinst.cxx  |   27 +++
 2 files changed, 22 insertions(+), 28 deletions(-)

New commits:
commit 0c7c475080a8d941db74060428a4a607e1a39b33
Author: Caolán McNamara 
AuthorDate: Thu Jan 27 09:01:08 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 27 11:44:25 2022 +0100

cid#1497856 Unchecked dynamic_cast

and

cid#1497857 Unchecked dynamic_cast
cid#1497858 Unchecked dynamic_cast
cid#1497859 Unchecked dynamic_cast
cid#1497860 Unchecked dynamic_cast
cid#1497861 Unchecked dynamic_cast

Change-Id: I29d3abc66e86bcf03ebcd6cc0ea9dfbc24f8ff3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129025
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 00039eb34c34..61789796f473 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1507,24 +1507,23 @@ void 
SalInstanceWindow::recursively_unset_default_buttons() { implResetDefault(m
 
 void SalInstanceWindow::change_default_widget(weld::Widget* pOld, 
weld::Widget* pNew)
 {
-if (!pOld)
-recursively_unset_default_buttons();
+SalInstanceWidget* pVclNew = dynamic_cast(pNew);
+vcl::Window* pWidgetNew = pVclNew ? pVclNew->getWidget() : nullptr;
+SalInstanceWidget* pVclOld = dynamic_cast(pOld);
+vcl::Window* pWidgetOld = pVclOld ? pVclOld->getWidget() : nullptr;
+if (pWidgetOld)
+pWidgetOld->set_property("has-default", OUString::boolean(false));
 else
-{
-SalInstanceWidget* pVclOld = dynamic_cast(pOld);
-pVclOld->getWidget()->set_property("has-default", 
OUString::boolean(false));
-}
-if (pNew)
-{
-SalInstanceWidget* pVclNew = dynamic_cast(pNew);
-pVclNew->getWidget()->set_property("has-default", 
OUString::boolean(true));
-}
+recursively_unset_default_buttons();
+if (pWidgetNew)
+pWidgetNew->set_property("has-default", OUString::boolean(true));
 }
 
 bool SalInstanceWindow::is_default_widget(const weld::Widget* pCandidate) const
 {
 const SalInstanceWidget* pVclCandidate = dynamic_cast(pCandidate);
-return pVclCandidate->getWidget()->GetStyle() & WB_DEFBUTTON;
+vcl::Window* pWidget = pVclCandidate ? pVclCandidate->getWidget() : 
nullptr;
+return pWidget && pWidget->GetStyle() & WB_DEFBUTTON;
 }
 
 void SalInstanceWindow::set_window_state(const OString& rStr)
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 5d681cf6cd23..e2801448ac73 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -6199,38 +6199,33 @@ public:
 
 virtual void change_default_widget(weld::Widget* pOld, weld::Widget* pNew) 
override
 {
-#if GTK_CHECK_VERSION(4, 0, 0)
 GtkInstanceWidget* pGtkNew = dynamic_cast(pNew);
 GtkWidget* pWidgetNew = pGtkNew ? pGtkNew->getWidget() : nullptr;
+#if GTK_CHECK_VERSION(4, 0, 0)
 gtk_window_set_default_widget(m_pWindow, pWidgetNew);
 (void)pOld;
 #else
-if (!pOld)
-recursively_unset_default_buttons();
-else
-{
-GtkInstanceWidget* pGtkOld = 
dynamic_cast(pOld);
-GtkWidget* pWidgetOld = pGtkOld->getWidget();
+GtkInstanceWidget* pGtkOld = dynamic_cast(pOld);
+GtkWidget* pWidgetOld = pGtkOld ? pGtkOld->getWidget() : nullptr;
+if (pWidgetOld)
 g_object_set(G_OBJECT(pWidgetOld), "has-default", false, nullptr);
-}
-if (pNew)
-{
-GtkInstanceWidget* pGtkNew = 
dynamic_cast(pNew);
-GtkWidget* pWidgetNew = pGtkNew->getWidget();
+else
+recursively_unset_default_buttons();
+if (pWidgetNew)
 g_object_set(G_OBJECT(pWidgetNew), "has-default", true, nullptr);
-}
 #endif
 }
 
 virtual bool is_default_widget(const weld::Widget* pCandidate) const 
override
 {
 const GtkInstanceWidget* pGtkCandidate = dynamic_cast(pCandidate);
-GtkWidget* pWidget = pGtkCandidate->getWidget();
+GtkWidget* pWidget = pGtkCandidate ? pGtkCandidate->getWidget() : 
nullptr;
 #if GTK_CHECK_VERSION(4, 0, 0)
-return gtk_window_get_default_widget(m_pWindow) == pWidget;
+return pWidget && gtk_window_get_default_widget(m_pWindow) == pWidget;
 #else
 gboolean has_default(false);
-g_object_get(G_OBJECT(pWidget), "has-default", _default, nullptr);
+if (pWidget)
+g_object_get(G_OBJECT(pWidget), "has-default", _default, 
nullptr);
 return has_default;
 #endif
 }


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

2022-01-19 Thread Jan-Marek Glogowski (via logerrit)
 vcl/source/app/svapp.cxx|2 +-
 vcl/unx/generic/app/geninst.cxx |   13 +++--
 2 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 5f3b92f89767deda73620bc5e77e1933dfa81dcc
Author: Jan-Marek Glogowski 
AuthorDate: Tue Nov 30 19:21:17 2021 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Wed Jan 19 16:11:45 2022 +0100

WASM add toolkit and Emscripten version to About

Change-Id: I095cbb17accf04654a928bf0d89c0fbf1f443c9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128610
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index f5e84b94bbd1..2e02bffcb7f2 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1204,7 +1204,7 @@ OUString Application::GetHWOSConfInfo(const int 
bSelection, const bool bLocalize
 #endif
 appendDetails(u"", Localize(SV_APP_DEFAULT, bLocalize));
 
-#if (defined LINUX || defined _WIN32 || defined MACOSX || defined __FreeBSD__)
+#if (defined LINUX || defined _WIN32 || defined MACOSX || defined __FreeBSD__ 
|| defined EMSCRIPTEN)
 appendDetails(u"; ", SV_APP_VCLBACKEND + GetToolkitName());
 #endif
 }
diff --git a/vcl/unx/generic/app/geninst.cxx b/vcl/unx/generic/app/geninst.cxx
index 0093f64376c6..705a30e86933 100644
--- a/vcl/unx/generic/app/geninst.cxx
+++ b/vcl/unx/generic/app/geninst.cxx
@@ -52,7 +52,6 @@ SalGenericInstance::~SalGenericInstance()
 OUString SalGenericInstance::getOSVersion()
 {
 OUString aKernelVer = "unknown";
-
 #if defined(LINUX)
 FILE* pVersion = fopen( "/proc/version", "r" );
 if ( pVersion )
@@ -72,7 +71,6 @@ OUString SalGenericInstance::getOSVersion()
 }
 fclose( pVersion );
 }
-return aKernelVer;
 #elif defined(__FreeBSD__)
 struct utsname stName;
 if ( uname(  ) != 0 )
@@ -87,11 +85,14 @@ OUString SalGenericInstance::getOSVersion()
 if ( c == ' ' || c == '-' || ( c == '.' && nDots++ > 0 ) )
 break;
 }
-return OUString::createFromAscii( stName.sysname ) + " " +
-aKernelVer.copy( 0, nIndex );
-#else
-return aKernelVer;
+aKernelVer = OUString::createFromAscii(stName.sysname) + " " + 
aKernelVer.copy(0, nIndex);
+#elif defined(EMSCRIPTEN)
+#define str(s) #s
+#define xstr(s) str(s)
+aKernelVer = "Emscripten " xstr(__EMSCRIPTEN_major__)
+ "." xstr(__EMSCRIPTEN_minor__) "." xstr(__EMSCRIPTEN_tiny__);
 #endif
+return aKernelVer;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-10-08 Thread Caolán McNamara (via logerrit)
 vcl/source/window/layout.cxx |   32 
 vcl/unx/gtk3/gtkdata.cxx |   36 ++--
 vcl/unx/gtk3/gtkinst.cxx |3 ++-
 vcl/unx/gtk4/convert3to4.cxx |4 ++--
 4 files changed, 38 insertions(+), 37 deletions(-)

New commits:
commit da1e9cba89128de05b8681469cdbc154f7624aad
Author: Caolán McNamara 
AuthorDate: Fri Oct 8 10:20:52 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 8 12:52:01 2021 +0200

sort buttons using id instead of HelpId

when created from the builder a widget's HelpId is the patch to the
widget and always ends in the widget id so this is no change for that
case, but when created directly by vcl for e.g. a MessageDialog while
the id is set the helpid is empty, so this means that Yes/No
MessageDialogs have their buttons sorted the same as if the Yes/No
buttons were explicitly spelled out in a builder .ui

Change-Id: Iee1a7146d2b6da76804856b1c4df8849ddd91a0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123253
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index e49396313449..16a49d300d23 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -746,33 +746,33 @@ namespace {
 
 struct ButtonOrder
 {
-const char* m_aType;
+std::u16string_view m_aType;
 int m_nPriority;
 };
 
 }
 
-static int getButtonPriority(std::string_view rType)
+static int getButtonPriority(std::u16string_view rType)
 {
 static const size_t N_TYPES = 6;
 static const ButtonOrder aDiscardCancelSave[N_TYPES] =
 {
-{ "/discard", 0 },
-{ "/cancel", 1 },
-{ "/no", 2 },
-{ "/save", 3 },
-{ "/yes", 3 },
-{ "/ok", 3 }
+{ u"discard", 0 },
+{ u"cancel", 1 },
+{ u"no", 2 },
+{ u"save", 3 },
+{ u"yes", 3 },
+{ u"ok", 3 }
 };
 
 static const ButtonOrder aSaveDiscardCancel[N_TYPES] =
 {
-{ "/save", 0 },
-{ "/yes", 0 },
-{ "/ok", 0 },
-{ "/discard", 1 },
-{ "/no", 1 },
-{ "/cancel", 2 }
+{ u"save", 0 },
+{ u"yes", 0 },
+{ u"ok", 0 },
+{ u"discard", 1 },
+{ u"no", 1 },
+{ u"cancel", 2 }
 };
 
 const ButtonOrder* pOrder = [0];
@@ -788,7 +788,7 @@ static int getButtonPriority(std::string_view rType)
 
 for (size_t i = 0; i < N_TYPES; ++i, ++pOrder)
 {
-if (o3tl::ends_with(rType, pOrder->m_aType))
+if (rType == pOrder->m_aType)
 return pOrder->m_nPriority;
 }
 
@@ -839,7 +839,7 @@ bool sortButtons::operator()(const vcl::Window *pA, const 
vcl::Window *pB) const
 }
 
 //now order within groups according to platform rules
-return getButtonPriority(pA->GetHelpId()) < 
getButtonPriority(pB->GetHelpId());
+return getButtonPriority(pA->get_id()) < getButtonPriority(pB->get_id());
 }
 
 void sort_native_button_order(const VclBox& rContainer)
diff --git a/vcl/unx/gtk3/gtkdata.cxx b/vcl/unx/gtk3/gtkdata.cxx
index c1381fe89daf..8f2afb4dc5a4 100644
--- a/vcl/unx/gtk3/gtkdata.cxx
+++ b/vcl/unx/gtk3/gtkdata.cxx
@@ -872,7 +872,7 @@ namespace {
 
 struct ButtonOrder
 {
-const char * m_aType;
+std::string_view m_aType;
 int m_nPriority;
 };
 
@@ -883,26 +883,26 @@ int getButtonPriority(std::string_view rType)
 static const size_t N_TYPES = 8;
 static const ButtonOrder aDiscardCancelSave[N_TYPES] =
 {
-{ "/discard", 0 },
-{ "/cancel", 1 },
-{ "/close", 1 },
-{ "/no", 2 },
-{ "/open", 3 },
-{ "/save", 3 },
-{ "/yes", 3 },
-{ "/ok", 3 }
+{ "discard", 0 },
+{ "cancel", 1 },
+{ "close", 1 },
+{ "no", 2 },
+{ "open", 3 },
+{ "save", 3 },
+{ "yes", 3 },
+{ "ok", 3 }
 };
 
 static const ButtonOrder aSaveDiscardCancel[N_TYPES] =
 {
-{ "/open", 0 },
-{ "/save", 0 },
-{ "/yes", 0 },
-{ "/ok", 0 },
-{ "/discard", 1 },
-{ "/no", 1 },
-{ "/cancel", 2 },
-{ "/close", 2 }
+{ "open", 0 },
+{ "save", 0 },
+{ "yes", 0 },
+{ "ok", 0 },
+{ "discard", 1 },
+{ "no", 1 },
+{ "cancel", 2 },
+{ "close", 2 }
 };
 
 const ButtonOrder* pOrder = [0];
@@ -918,7 +918,7 @@ int getButtonPriority(std::string_view rType)
 
 for (size_t i = 0; i < N_TYPES; ++i, ++pOrder)
 {
-if (o3tl::ends_with(rType, pOrder->m_aType))
+if (rType == pOrder->m_aType)
 return pOrder->m_nPriority;
 }
 
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 3cd60a2777a6..ec87c2785741 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -5732,7 +5732,8 @@ namespace {
 bool sortButtons(const GtkWidget* pA, const GtkWidget* 

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

2021-05-10 Thread Caolán McNamara (via logerrit)
 vcl/source/window/builder.cxx |2 +-
 vcl/unx/gtk3/gtkframe.cxx |   15 ---
 2 files changed, 5 insertions(+), 12 deletions(-)

New commits:
commit 7db0efb7a318d8628168d3ca7bab1690f15828e2
Author: Caolán McNamara 
AuthorDate: Mon May 10 12:12:47 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 10 15:58:39 2021 +0200

gtk4: use GDK_ALT_MASK

define GDK_ALT_MASK as GDK_MOD1_MASK for gtk3

Change-Id: Iff6340956b83403af37b0416a234b6937f1bea18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115328
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 32267d8c95b2..522ec374693c 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -3416,7 +3416,7 @@ namespace
 {
 bool bShift = rKey.second.indexOf("GDK_SHIFT_MASK") != -1;
 bool bMod1 = rKey.second.indexOf("GDK_CONTROL_MASK") != -1;
-bool bMod2 = rKey.second.indexOf("GDK_MOD1_MASK") != -1;
+bool bMod2 = rKey.second.indexOf("GDK_ALT_MASK") != -1;
 bool bMod3 = rKey.second.indexOf("GDK_MOD2_MASK") != -1;
 
 if (rKey.first == "Insert")
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 6fd2466a0f85..004fde48b3ea 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -61,6 +61,10 @@
 #include 
 #include 
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
+#   define GDK_ALT_MASK GDK_MOD1_MASK
+#endif
+
 using namespace com::sun::star;
 
 int GtkSalFrame::m_nFloats = 0;
@@ -74,13 +78,8 @@ sal_uInt16 GtkSalFrame::GetKeyModCode( guint state )
 nCode |= KEY_SHIFT;
 if( state & GDK_CONTROL_MASK )
 nCode |= KEY_MOD1;
-#if !GTK_CHECK_VERSION(4, 0, 0)
-if( state & GDK_MOD1_MASK )
-nCode |= KEY_MOD2;
-#else
 if (state & GDK_ALT_MASK)
 nCode |= KEY_MOD2;
-#endif
 if( state & GDK_SUPER_MASK )
 nCode |= KEY_MOD3;
 return nCode;
@@ -2324,13 +2323,7 @@ void GtkSalFrame::KeyCodeToGdkKey(const vcl::KeyCode& 
rKeyCode,
 nModifiers = static_cast( nModifiers | 
GDK_CONTROL_MASK );
 
 if ( rKeyCode.IsMod2() )
-{
-#if !GTK_CHECK_VERSION(4, 0, 0)
-nModifiers = static_cast( nModifiers | GDK_MOD1_MASK 
);
-#else
 nModifiers = static_cast( nModifiers | GDK_ALT_MASK );
-#endif
-}
 
 *pGdkModifiers = nModifiers;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-13 Thread sarynasser (via logerrit)
 vcl/source/treelist/iconviewimpl.hxx|5 +
 vcl/source/uitest/uno/uiobject_uno.hxx  |5 +
 vcl/source/window/bufferdevice.hxx  |5 +
 vcl/source/window/dlgctrl.hxx   |5 +
 vcl/source/window/menubarwindow.hxx |4 +---
 vcl/source/window/menufloatingwindow.hxx|4 +---
 vcl/source/window/menuwindow.hxx|4 +---
 vcl/unx/generic/dtrans/X11_clipboard.hxx|5 +
 vcl/unx/generic/dtrans/X11_dndcontext.hxx   |5 +
 vcl/unx/generic/dtrans/X11_selection.hxx|5 +
 vcl/unx/generic/dtrans/X11_transferable.hxx |5 +
 vcl/unx/generic/dtrans/bmp.hxx  |5 +
 vcl/unx/generic/gdi/cairo_xlib_cairo.hxx|5 +
 vcl/unx/generic/gdi/gdiimpl.hxx |5 +
 vcl/unx/generic/print/glyphset.hxx  |5 +
 vcl/unx/generic/print/prtsetup.hxx  |5 +
 vcl/unx/generic/print/psputil.hxx   |5 +
 vcl/unx/gtk3/a11y/atkfactory.hxx|5 +
 vcl/unx/gtk3/a11y/atklistener.hxx   |5 +
 vcl/unx/gtk3/a11y/atkregistry.hxx   |5 +
 vcl/unx/gtk3/a11y/atktextattributes.hxx |5 +
 vcl/unx/gtk3/a11y/atkutil.hxx   |5 +
 vcl/unx/gtk3/a11y/atkwrapper.hxx|5 +
 vcl/unx/gtk3/cairo_gtk3_cairo.hxx   |5 +
 vcl/unx/gtk3/fpicker/SalGtkFilePicker.hxx   |5 +
 vcl/unx/gtk3/fpicker/SalGtkFolderPicker.hxx |5 +
 vcl/unx/gtk3/fpicker/eventnotification.hxx  |5 +
 vcl/win/gdi/gdiimpl.hxx |5 +
 28 files changed, 28 insertions(+), 109 deletions(-)

New commits:
commit 77419c6f3aba1fd5b1660795923c22a39bdb1bad
Author: sarynasser 
AuthorDate: Tue Apr 13 15:25:50 2021 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Tue Apr 13 21:04:34 2021 +0200

tdf#124176 Use pragma once in vcl

Change-Id: I30834d8686763d8972cb1579341eefb43ae300c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114052
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Ilmari Lauhakangas 

diff --git a/vcl/source/treelist/iconviewimpl.hxx 
b/vcl/source/treelist/iconviewimpl.hxx
index 9436324bc566..be038eee587d 100644
--- a/vcl/source/treelist/iconviewimpl.hxx
+++ b/vcl/source/treelist/iconviewimpl.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_SOURCE_INC_ICONVIEWIMPL_HXX
-#define INCLUDED_VCL_SOURCE_INC_ICONVIEWIMPL_HXX
+#pragma once
 
 #include 
 
@@ -63,6 +62,4 @@ protected:
 void AdjustScrollBars(Size& rSize) override;
 };
 
-#endif // INCLUDED_VCL_SOURCE_INC_ICONVIEWIMPL_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/uitest/uno/uiobject_uno.hxx 
b/vcl/source/uitest/uno/uiobject_uno.hxx
index 426f9d0476b8..f52cdeffe95d 100644
--- a/vcl/source/uitest/uno/uiobject_uno.hxx
+++ b/vcl/source/uitest/uno/uiobject_uno.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_VCL_SOURCE_UITEST_UNO_UIOBJECT_UNO_HXX
-#define INCLUDED_VCL_SOURCE_UITEST_UNO_UIOBJECT_UNO_HXX
+#pragma once
 
 #include 
 #include 
@@ -70,6 +69,4 @@ private:
 css::uno::Sequence mPropValues;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/bufferdevice.hxx 
b/vcl/source/window/bufferdevice.hxx
index f785b6bdcbee..eafc829e5910 100644
--- a/vcl/source/window/bufferdevice.hxx
+++ b/vcl/source/window/bufferdevice.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_VCL_SOURCE_WINDOW_BUFFERDEVICE_HXX
-#define INCLUDED_VCL_SOURCE_WINDOW_BUFFERDEVICE_HXX
+#pragma once
 
 #include 
 #include 
@@ -33,6 +32,4 @@ public:
 };
 }
 
-#endif // INCLUDED_VCL_SOURCE_WINDOW_BUFFERDEVICE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dlgctrl.hxx b/vcl/source/window/dlgctrl.hxx
index d14f8e32672f..805099b69bac 100644
--- a/vcl/source/window/dlgctrl.hxx
+++ b/vcl/source/window/dlgctrl.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_SOURCE_WINDOW_DLGCTRL_HXX
-#define INCLUDED_VCL_SOURCE_WINDOW_DLGCTRL_HXX
+#pragma once
 
 #include 
 
@@ -32,6 +31,4 @@ vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, 
sal_uInt16& rIndex, sal_
 
 sal_Unicode getAccel( const OUString& rStr );
 
-#endif // INCLUDED_VCL_SOURCE_WINDOW_DLGCTRL_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/menubarwindow.hxx 
b/vcl/source/window/menubarwindow.hxx
index 01b26b020b5d..570ffc5d20ca 100644
--- a/vcl/source/window/menubarwindow.hxx
+++ b/vcl/source/window/menubarwindow.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_SOURCE_WINDOW_MENUBARWINDOW_HXX
-#define INCLUDED_VCL_SOURCE_WINDOW_MENUBARWINDOW_HXX
+#pragma 

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

2021-03-22 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/itiff/lzwdecom.cxx |   23 ---
 vcl/source/filter/itiff/lzwdecom.hxx |2 +-
 vcl/unx/generic/print/bitmap_gfx.cxx |   19 ++-
 3 files changed, 23 insertions(+), 21 deletions(-)

New commits:
commit 4566bcbf03c1b7b0c1ce3a83fee1d195f0ff7059
Author: Caolán McNamara 
AuthorDate: Mon Mar 22 10:53:37 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 22 15:05:49 2021 +0100

cid#707834 silence Uninitialized scalar field

and

cid#1474340 silence Uninitialized scalar field

Change-Id: Ib5d12595bfcd2eaf5b26ce333d5ea8328fdeb2aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112880
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/filter/itiff/lzwdecom.cxx 
b/vcl/source/filter/itiff/lzwdecom.cxx
index 15784321b92e..14a7e276f4ee 100644
--- a/vcl/source/filter/itiff/lzwdecom.cxx
+++ b/vcl/source/filter/itiff/lzwdecom.cxx
@@ -24,6 +24,7 @@
 
 LZWDecompressor::LZWDecompressor()
 : pIStream(nullptr)
+, aTable{{}}
 , nTableSize(0)
 , bEOIFound(false)
 , bInvert(false)
@@ -36,9 +37,9 @@ LZWDecompressor::LZWDecompressor()
 {
 for (sal_uInt16 i=0; i(i);
+aTable[i].nPrevCode=0;
+aTable[i].nDataCount=1;
+aTable[i].nData=static_cast(i);
 }
 }
 
@@ -156,7 +157,7 @@ void LZWDecompressor::AddToTable(sal_uInt16 nPrevCode, 
sal_uInt16 nCodeFirstData
 }
 
 unsigned char aSeenIndexes[MAX_TABLE_SIZE] = {0};
-while (pTable[nCodeFirstData].nDataCount>1)
+while (aTable[nCodeFirstData].nDataCount>1)
 {
 if (aSeenIndexes[nCodeFirstData])
 {
@@ -165,12 +166,12 @@ void LZWDecompressor::AddToTable(sal_uInt16 nPrevCode, 
sal_uInt16 nCodeFirstData
 return;
 }
 aSeenIndexes[nCodeFirstData] = 1;
-nCodeFirstData=pTable[nCodeFirstData].nPrevCode;
+nCodeFirstData=aTable[nCodeFirstData].nPrevCode;
 }
 
-pTable[nTableSize].nPrevCode=nPrevCode;
-pTable[nTableSize].nDataCount=pTable[nPrevCode].nDataCount+1;
-pTable[nTableSize].nData=pTable[nCodeFirstData].nData;
+aTable[nTableSize].nPrevCode=nPrevCode;
+aTable[nTableSize].nDataCount=aTable[nPrevCode].nDataCount+1;
+aTable[nTableSize].nData=aTable[nCodeFirstData].nData;
 
 nTableSize++;
 }
@@ -204,12 +205,12 @@ void LZWDecompressor::DecompressSome()
 
 nOldCode=nCode;
 
-nOutBufDataLen=pTable[nCode].nDataCount;
+nOutBufDataLen=aTable[nCode].nDataCount;
 pOutBufData=pOutBuf.data()+nOutBufDataLen;
 for (i=0; i pTable;
+std::array aTable;
 sal_uInt16 nTableSize;
 
 bool bEOIFound, bInvert, bFirst;
diff --git a/vcl/unx/generic/print/bitmap_gfx.cxx 
b/vcl/unx/generic/print/bitmap_gfx.cxx
index 4ddce0214190..830561b9677f 100644
--- a/vcl/unx/generic/print/bitmap_gfx.cxx
+++ b/vcl/unx/generic/print/bitmap_gfx.cxx
@@ -299,7 +299,7 @@ private:
 };
 
 std::array
-mpTable;// LZW compression data
+maTable;// LZW compression data
 LZWCTreeNode*   mpPrefix;   // the compression is as same as the TIFF 
compression
 static constexpr sal_uInt16 gnDataSize = 8;
 static constexpr sal_uInt16 gnClearCode = 1 << gnDataSize;
@@ -323,6 +323,7 @@ public:
 
 LZWEncoder::LZWEncoder(osl::File* pOutputFile) :
 Ascii85Encoder (pOutputFile),
+maTable{{}},
 mpPrefix(nullptr),
 mnTableSize(gnEOICode + 1),
 mnCodeSize(gnDataSize + 1),
@@ -331,10 +332,10 @@ LZWEncoder::LZWEncoder(osl::File* pOutputFile) :
 {
 for (sal_uInt32 i = 0; i < 4096; i++)
 {
-mpTable[i].mpBrother= nullptr;
-mpTable[i].mpFirstChild = nullptr;
-mpTable[i].mnCode   = i;
-mpTable[i].mnValue  = static_cast(mpTable[i].mnCode);
+maTable[i].mpBrother= nullptr;
+maTable[i].mpFirstChild = nullptr;
+maTable[i].mnCode   = i;
+maTable[i].mnValue  = static_cast(maTable[i].mnCode);
 }
 
 WriteBits( gnClearCode, mnCodeSize );
@@ -372,7 +373,7 @@ LZWEncoder::EncodeByte (sal_uInt8 nByte )
 
 if (!mpPrefix)
 {
-mpPrefix = mpTable.data() + nByte;
+mpPrefix = maTable.data() + nByte;
 }
 else
 {
@@ -396,7 +397,7 @@ LZWEncoder::EncodeByte (sal_uInt8 nByte )
 WriteBits (gnClearCode, mnCodeSize);
 
 for (i = 0; i < gnClearCode; i++)
-mpTable[i].mpFirstChild = nullptr;
+maTable[i].mpFirstChild = nullptr;
 
 mnCodeSize = gnDataSize + 1;
 mnTableSize = gnEOICode + 1;
@@ -406,14 +407,14 @@ LZWEncoder::EncodeByte (sal_uInt8 nByte )
 if(mnTableSize == static_cast((1 << mnCodeSize) - 
1))
 mnCodeSize++;
 
-p = mpTable.data() + (mnTableSize++);
+p = maTable.data() + (mnTableSize++);
 p->mpBrother = mpPrefix->mpFirstChild;
 

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

2021-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/window/paint.cxx  |   18 --
 vcl/unx/generic/print/genpspgraphics.cxx |   14 --
 2 files changed, 32 deletions(-)

New commits:
commit ebbaf83bcf18b8c78fb65a617e02e82d5163d319
Author: Caolán McNamara 
AuthorDate: Sun Feb 28 20:18:03 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 1 10:10:03 2021 +0100

drop commented out code

since...

commit e717d1dcce7f8906311c5ccdbb2326b61a702630
Date:   Tue Oct 23 12:46:28 2012 +

Resolves: #i121237# Rework/Cleanup of Region code...

Change-Id: I6851ad46f3fc341e9f64f6c3d7cebd804e06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111719
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 48149f50b056..e673299095b9 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1088,24 +1088,6 @@ void Window::SetWindowRegionPixel( const vcl::Region& 
rRegion )
 }
 
 mpWindowImpl->mpFrame->EndSetClipRegion();
-
-//longnX;
-//longnY;
-//longnWidth;
-//longnHeight;
-//sal_uLong   nRectCount;
-//ImplRegionInfo  aInfo;
-//sal_BoolbRegionRect;
-
-//nRectCount = mpWindowImpl->maWinRegion.GetRectCount();
-//mpWindowImpl->mpFrame->BeginSetClipRegion( nRectCount );
-//bRegionRect = mpWindowImpl->maWinRegion.ImplGetFirstRect( 
aInfo, nX, nY, nWidth, nHeight );
-//while ( bRegionRect )
-//{
-//mpWindowImpl->mpFrame->UnionClipRegion( nX, nY, nWidth, 
nHeight );
-//bRegionRect = mpWindowImpl->maWinRegion.ImplGetNextRect( 
aInfo, nX, nY, nWidth, nHeight );
-//}
-//mpWindowImpl->mpFrame->EndSetClipRegion();
 }
 else
 SetWindowRegionPixel();
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx 
b/vcl/unx/generic/print/genpspgraphics.cxx
index eb427b2a73af..da5092da4809 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -264,20 +264,6 @@ bool GenPspGraphics::setClipRegion( const vcl::Region& 
i_rClip )
 
 m_pPrinterGfx->EndSetClipRegion();
 
-//m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
-
-//ImplRegionInfo aInfo;
-//long nX, nY, nW, nH;
-//bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
-//while( bRegionRect )
-//{
-//if ( nW && nH )
-//{
-//m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH );
-//}
-//bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
-//}
-//m_pPrinterGfx->EndSetClipRegion();
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-10 Thread Caolán McNamara (via logerrit)
 vcl/source/window/layout.cxx |2 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx |   35 +++
 2 files changed, 20 insertions(+), 17 deletions(-)

New commits:
commit f88c03b1d115cd09e3271b278b39bf600e21f6cd
Author: Caolán McNamara 
AuthorDate: Tue Nov 10 17:25:42 2020 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 10 21:03:39 2020 +0100

sync the vcl expander default with the gtk one to !m_bResizeTopLevel

Change-Id: Ia186514efa9e670ce2287201f16978fc1b0e9146
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105564
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 676fae9dbc4f..6cbc00e05e72 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1623,7 +1623,7 @@ public:
 
 VclExpander::VclExpander(vcl::Window *pParent)
 : VclBin(pParent)
-, m_bResizeTopLevel(true)
+, m_bResizeTopLevel(false)
 , m_pDisclosureButton(VclPtr::Create(this))
 {
 m_pDisclosureButton->SetToggleHdl(LINK(this, VclExpander, ClickHdl));
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index db2b765841ff..83cf0aad9cec 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -16150,26 +16150,29 @@ private:
 GtkInstanceExpander* pThis = static_cast(widget);
 SolarMutexGuard aGuard;
 
-GtkWidget *pToplevel = gtk_widget_get_toplevel(GTK_WIDGET(pExpander));
-
-// https://gitlab.gnome.org/GNOME/gtk/issues/70
-// I imagine at some point a release with a fix will be available in 
which
-// case this can be avoided depending on version number
-if (pToplevel && GTK_IS_WINDOW(pToplevel) && 
gtk_widget_get_realized(pToplevel))
+if (gtk_expander_get_resize_toplevel(pExpander))
 {
-int nToplevelWidth, nToplevelHeight;
-int nChildHeight;
+GtkWidget *pToplevel = 
gtk_widget_get_toplevel(GTK_WIDGET(pExpander));
 
-GtkWidget* child = gtk_bin_get_child(GTK_BIN(pExpander));
-gtk_widget_get_preferred_height(child, , nullptr);
-gtk_window_get_size(GTK_WINDOW(pToplevel), , 
);
+// https://gitlab.gnome.org/GNOME/gtk/issues/70
+// I imagine at some point a release with a fix will be available 
in which
+// case this can be avoided depending on version number
+if (pToplevel && GTK_IS_WINDOW(pToplevel) && 
gtk_widget_get_realized(pToplevel))
+{
+int nToplevelWidth, nToplevelHeight;
+int nChildHeight;
 
-if (pThis->get_expanded())
-nToplevelHeight += nChildHeight;
-else
-nToplevelHeight -= nChildHeight;
+GtkWidget* child = gtk_bin_get_child(GTK_BIN(pExpander));
+gtk_widget_get_preferred_height(child, , nullptr);
+gtk_window_get_size(GTK_WINDOW(pToplevel), , 
);
 
-gtk_window_resize(GTK_WINDOW(pToplevel), nToplevelWidth, 
nToplevelHeight);
+if (pThis->get_expanded())
+nToplevelHeight += nChildHeight;
+else
+nToplevelHeight -= nChildHeight;
+
+gtk_window_resize(GTK_WINDOW(pToplevel), nToplevelWidth, 
nToplevelHeight);
+}
 }
 
 pThis->signal_expanded();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-07 Thread Caolán McNamara (via logerrit)
 vcl/source/window/builder.cxx |8 +++-
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   27 +++
 2 files changed, 22 insertions(+), 13 deletions(-)

New commits:
commit bd567a409f214d042bd64798f168fdb3dbf3cd31
Author: Caolán McNamara 
AuthorDate: Tue Oct 6 20:47:22 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 7 16:18:36 2020 +0200

support pan-down-symbolic/pan-up-symbolic as SPIN_DOWN/SPIN_UP

Change-Id: I37bb7474207a084cfce7a3c2a6d9ec507b963aba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104044
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index e182fc265b66..a3b91e718f49 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -655,7 +655,13 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const 
OUString& sUIDir, const OUStr
 {
 if (!elem.m_bRadio)
 {
-pTargetButton->SetModeImage(pImage->GetImage());
+const Image& rImage = pImage->GetImage();
+if (rImage.GetStock() == "pan-down-symbolic")
+pTargetButton->SetSymbol(SymbolType::SPIN_DOWN);
+else if (rImage.GetStock() == "pan-up-symbolic")
+pTargetButton->SetSymbol(SymbolType::SPIN_UP);
+else
+pTargetButton->SetModeImage(rImage);
 if (pImage->GetStyle() & WB_SMALLSTYLE)
 {
 pTargetButton->SetStyle(pTargetButton->GetStyle() | 
WB_SMALLSTYLE);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 8d4dff537f38..ddea5a54a9aa 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -16027,28 +16027,31 @@ private:
 if (icon_name)
 {
 OUString aIconName(icon_name, strlen(icon_name), 
RTL_TEXTENCODING_UTF8);
-GdkPixbuf* pixbuf = load_icon_by_name_theme_lang(aIconName, 
m_aIconTheme, m_aUILang);
-if (pixbuf)
+if (aIconName != "pan-up-symbolic" && aIconName != 
"pan-down-symbolic")
 {
-gtk_image_set_from_pixbuf(pImage, pixbuf);
-g_object_unref(pixbuf);
+if (GdkPixbuf* pixbuf = 
load_icon_by_name_theme_lang(aIconName, m_aIconTheme, m_aUILang))
+{
+gtk_image_set_from_pixbuf(pImage, pixbuf);
+g_object_unref(pixbuf);
+}
 }
 }
 }
 else if (GTK_IS_TOOL_BUTTON(pWidget))
 {
 GtkToolButton* pToolButton = GTK_TOOL_BUTTON(pWidget);
-const gchar* icon_name = 
gtk_tool_button_get_icon_name(pToolButton);
-if (icon_name)
+if (const gchar* icon_name = 
gtk_tool_button_get_icon_name(pToolButton))
 {
 OUString aIconName(icon_name, strlen(icon_name), 
RTL_TEXTENCODING_UTF8);
-GdkPixbuf* pixbuf = load_icon_by_name_theme_lang(aIconName, 
m_aIconTheme, m_aUILang);
-if (pixbuf)
+if (aIconName != "pan-up-symbolic" && aIconName != 
"pan-down-symbolic")
 {
-GtkWidget* pImage = gtk_image_new_from_pixbuf(pixbuf);
-g_object_unref(pixbuf);
-gtk_tool_button_set_icon_widget(pToolButton, pImage);
-gtk_widget_show(pImage);
+if (GdkPixbuf* pixbuf = 
load_icon_by_name_theme_lang(aIconName, m_aIconTheme, m_aUILang))
+{
+GtkWidget* pImage = gtk_image_new_from_pixbuf(pixbuf);
+g_object_unref(pixbuf);
+gtk_tool_button_set_icon_widget(pToolButton, pImage);
+gtk_widget_show(pImage);
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-19 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   78 --
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   36 ---
 2 files changed, 69 insertions(+), 45 deletions(-)

New commits:
commit 55053394c1253cb55109af354e417288486bf81e
Author: Caolán McNamara 
AuthorDate: Wed Aug 19 12:11:49 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 19 16:28:48 2020 +0200

use switch statement

Change-Id: I64a61a2d08196b86e0dcb789c06a2b90f62a8097
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100992
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 906cd00cffe3..9e6fb8e54904 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3153,27 +3153,27 @@ bool SalInstanceEntry::get_overwrite_mode() const
 
 void SalInstanceEntry::set_message_type(weld::EntryMessageType eType)
 {
-if (eType == weld::EntryMessageType::Error)
-{
-// tdf#114603: enable setting the background to a different color;
-// relevant for GTK; see also #i75179#
-m_xEntry->SetForceControlBackground(true);
-m_xEntry->SetControlForeground(COL_WHITE);
-m_xEntry->SetControlBackground(0xff6563);
-}
-else if (eType == weld::EntryMessageType::Warning)
-{
-// tdf#114603: enable setting the background to a different color;
-// relevant for GTK; see also #i75179#
-m_xEntry->SetForceControlBackground(true);
-m_xEntry->SetControlForeground();
-m_xEntry->SetControlBackground(COL_YELLOW);
-}
-else
+switch (eType)
 {
-m_xEntry->SetForceControlBackground(false);
-m_xEntry->SetControlForeground();
-m_xEntry->SetControlBackground();
+case weld::EntryMessageType::Normal:
+m_xEntry->SetForceControlBackground(false);
+m_xEntry->SetControlForeground();
+m_xEntry->SetControlBackground();
+break;
+case weld::EntryMessageType::Warning:
+// tdf#114603: enable setting the background to a different color;
+// relevant for GTK; see also #i75179#
+m_xEntry->SetForceControlBackground(true);
+m_xEntry->SetControlForeground();
+m_xEntry->SetControlBackground(COL_YELLOW);
+break;
+case weld::EntryMessageType::Error:
+// tdf#114603: enable setting the background to a different color;
+// relevant for GTK; see also #i75179#
+m_xEntry->SetForceControlBackground(true);
+m_xEntry->SetControlForeground(COL_WHITE);
+m_xEntry->SetControlBackground(0xff6563);
+break;
 }
 }
 
@@ -5488,13 +5488,19 @@ void SalInstanceLabel::set_mnemonic_widget(Widget* 
pTarget)
 
 void SalInstanceLabel::set_message_type(weld::EntryMessageType eType)
 {
-if (eType == weld::EntryMessageType::Error)
-m_xLabel->SetControlBackground(
-m_xLabel->GetSettings().GetStyleSettings().GetHighlightColor());
-else if (eType == weld::EntryMessageType::Warning)
-m_xLabel->SetControlBackground(COL_YELLOW);
-else
-m_xLabel->SetControlBackground();
+switch (eType)
+{
+case weld::EntryMessageType::Normal:
+m_xLabel->SetControlBackground();
+break;
+case weld::EntryMessageType::Warning:
+m_xLabel->SetControlBackground(COL_YELLOW);
+break;
+case weld::EntryMessageType::Error:
+m_xLabel->SetControlBackground(
+
m_xLabel->GetSettings().GetStyleSettings().GetHighlightColor());
+break;
+}
 }
 
 void SalInstanceLabel::set_font(const vcl::Font& rFont)
@@ -6050,12 +6056,18 @@ bool 
SalInstanceComboBoxWithEdit::changed_by_direct_pick() const
 
 void 
SalInstanceComboBoxWithEdit::set_entry_message_type(weld::EntryMessageType 
eType)
 {
-if (eType == weld::EntryMessageType::Error)
-m_xComboBox->SetControlForeground(Color(0xf0, 0, 0));
-else if (eType == weld::EntryMessageType::Warning)
-m_xComboBox->SetControlForeground(COL_YELLOW);
-else
-m_xComboBox->SetControlForeground();
+switch (eType)
+{
+case weld::EntryMessageType::Normal:
+m_xComboBox->SetControlForeground();
+break;
+case weld::EntryMessageType::Warning:
+m_xComboBox->SetControlForeground(COL_YELLOW);
+break;
+case weld::EntryMessageType::Error:
+m_xComboBox->SetControlForeground(Color(0xf0, 0, 0));
+break;
+}
 }
 
 OUString SalInstanceComboBoxWithEdit::get_active_text() const { return 
m_xComboBox->GetText(); }
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index bfd3c32eca6c..a1f57e0e14dd 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -8694,12 +8694,18 @@ namespace
 {
 void 

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

2020-07-22 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   35 +--
 vcl/unx/gtk3/gtk3gtkinst.cxx  |2 ++
 2 files changed, 31 insertions(+), 6 deletions(-)

New commits:
commit 40251f0e73d2cb700313395dcf49c43a9c1e8570
Author: Caolán McNamara 
AuthorDate: Wed Jul 22 14:44:39 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jul 22 20:47:19 2020 +0200

avoid intermediate bitmap causing blurring

and use incoming device as background

Change-Id: I13eea4148527fa2c3552db12555ca1ca005d7799
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99232
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 9765711e3869..699c06287e05 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1134,15 +1134,38 @@ std::unique_ptr 
SalInstanceWidget::weld_parent() const
 return std::make_unique(pParent, m_pBuilder, false);
 }
 
+namespace
+{
+void DoRecursivePaint(vcl::Window* pWindow, const Point& rPos, 
OutputDevice& rOutput)
+{
+Size aSize = pWindow->GetSizePixel();
+
+VclPtr 
xOutput(VclPtr::Create(DeviceFormat::DEFAULT));
+xOutput->SetOutputSizePixel(aSize);
+xOutput->DrawOutDev(Point(), aSize, rPos, aSize, rOutput);
+
+pWindow->Paint(*xOutput, tools::Rectangle(Point(), aSize));
+
+rOutput.DrawOutDev(rPos, aSize, Point(), aSize, *xOutput);
+
+xOutput.disposeAndClear();
+
+for (vcl::Window *pChild = 
pWindow->GetWindow(GetWindowType::FirstChild); pChild; pChild = 
pChild->GetWindow(GetWindowType::Next))
+{
+if (!pChild->IsVisible())
+continue;
+DoRecursivePaint(pChild, rPos + pChild->GetPosPixel(), rOutput);
+}
+}
+}
+
 void SalInstanceWidget::draw(OutputDevice& rOutput, const tools::Rectangle& 
rRect)
 {
 Size aOrigSize(m_xWidget->GetSizePixel());
-Size aSize = rRect.GetSize();
-m_xWidget->SetSizePixel(aSize);
-rOutput.Push(PushFlags::CLIPREGION);
-rOutput.IntersectClipRegion(rRect);
-m_xWidget->PaintToDevice(, rRect.TopLeft());
-rOutput.Pop();
+
+m_xWidget->SetSizePixel(rRect.GetSize());
+DoRecursivePaint(m_xWidget, rRect.TopLeft(), rOutput);
+
 m_xWidget->SetSizePixel(aOrigSize);
 }
 
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index faa07934e57e..8d6c2b1e345b 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3079,6 +3079,8 @@ public:
 
 VclPtr 
xOutput(VclPtr::Create(DeviceFormat::DEFAULT));
 xOutput->SetOutputSizePixel(aSize);
+xOutput->DrawOutDev(Point(), aSize, rRect.TopLeft(), aSize, rOutput);
+
 cairo_surface_t* pSurface = get_underlying_cairo_surface(*xOutput);
 cairo_t* cr = cairo_create(pSurface);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-08 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |3 +++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   11 ++-
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 10a5df7de19c86b362976b4bd8cee32da4413547
Author: Caolán McNamara 
AuthorDate: Tue Jul 7 20:27:51 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jul 8 20:24:23 2020 +0200

improve weld::Widget::draw rendering a widget

Change-Id: I1f49e3e7829f41d7eb4ffc137a9b0ab5c47d2cce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98375
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 81c2e38085c3..4121165b37a5 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1137,7 +1137,10 @@ void SalInstanceWidget::draw(OutputDevice& rOutput, 
const tools::Rectangle& rRec
 {
 Size aOrigSize(m_xWidget->GetSizePixel());
 m_xWidget->SetSizePixel(rRect.GetSize());
+rOutput.Push(PushFlags::CLIPREGION);
+rOutput.IntersectClipRegion(rRect);
 m_xWidget->Draw(, rRect.TopLeft(), DrawFlags::NONE);
+rOutput.Pop();
 m_xWidget->SetSizePixel(aOrigSize);
 }
 
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index cba5c662baff..5ba41f9e028a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3047,10 +3047,10 @@ public:
 // has to be mapped for draw to work
 bool bAlreadyMapped = gtk_widget_get_mapped(m_pWidget);
 
-if (!bAlreadyVisible)
-gtk_widget_show(m_pWidget);
 if (!bAlreadyRealized)
 gtk_widget_realize(m_pWidget);
+if (!bAlreadyVisible)
+gtk_widget_show(m_pWidget);
 if (!bAlreadyMapped)
 gtk_widget_map(m_pWidget);
 
@@ -3065,7 +3065,7 @@ public:
   aOrigAllocation.y,
   static_cast(aSize.Width()),
   static_cast(aSize.Height()) };
-gtk_widget_set_allocation(m_pWidget, );
+gtk_widget_size_allocate(m_pWidget, );
 
 if (GTK_IS_CONTAINER(m_pWidget))
 gtk_container_resize_children(GTK_CONTAINER(m_pWidget));
@@ -3080,13 +3080,14 @@ public:
 cairo_destroy(cr);
 
 gtk_widget_set_allocation(m_pWidget, );
+gtk_widget_size_allocate(m_pWidget, );
 
 rOutput.DrawOutDev(rRect.TopLeft(), aSize, Point(), aSize, *xOutput);
 
-if (!bAlreadyVisible)
-gtk_widget_hide(m_pWidget);
 if (!bAlreadyMapped)
 gtk_widget_unmap(m_pWidget);
+if (!bAlreadyVisible)
+gtk_widget_hide(m_pWidget);
 if (!bAlreadyRealized)
 gtk_widget_unrealize(m_pWidget);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-02 Thread Szymon Kłos (via logerrit)
 vcl/source/app/customweld.cxx |2 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   12 
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit f7b2e98bb76d2ce37ddc886ab503c6b160d8849d
Author: Szymon Kłos 
AuthorDate: Wed Jul 1 09:02:17 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 3 07:39:49 2020 +0200

gtk3: receive mouse events on drawing area

Change-Id: I35ec84c7e2e849625db7d628e1fa2e3807b3ef21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97566
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97743
Tested-by: Jenkins

diff --git a/vcl/source/app/customweld.cxx b/vcl/source/app/customweld.cxx
index 07dc7935b198..e8ce7003532a 100644
--- a/vcl/source/app/customweld.cxx
+++ b/vcl/source/app/customweld.cxx
@@ -25,6 +25,7 @@ CustomWeld::CustomWeld(weld::Builder& rBuilder, const 
OString& rDrawingId,
 
rWidgetController.GetUITestFactory(),
 ))
 {
+m_rWidgetController.SetDrawingArea(m_xDrawingArea.get());
 m_xDrawingArea->connect_size_allocate(LINK(this, CustomWeld, DoResize));
 m_xDrawingArea->connect_draw(LINK(this, CustomWeld, DoPaint));
 m_xDrawingArea->connect_mouse_press(LINK(this, CustomWeld, 
DoMouseButtonDown));
@@ -37,7 +38,6 @@ CustomWeld::CustomWeld(weld::Builder& rBuilder, const 
OString& rDrawingId,
 m_xDrawingArea->connect_style_updated(LINK(this, CustomWeld, 
DoStyleUpdated));
 m_xDrawingArea->connect_command(LINK(this, CustomWeld, DoCommand));
 m_xDrawingArea->connect_query_tooltip(LINK(this, CustomWeld, 
DoRequestHelp));
-m_rWidgetController.SetDrawingArea(m_xDrawingArea.get());
 }
 
 IMPL_LINK(CustomWeld, DoResize, const Size&, rSize, void)
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 0959bb53421e..9791b7f28cc2 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -12761,6 +12761,18 @@ public:
 return m_pAccessible;
 }
 
+virtual void connect_mouse_press(const Link& 
rLink) override
+{
+gtk_widget_add_events(m_pWidget, GDK_BUTTON_PRESS_MASK);
+GtkInstanceWidget::connect_mouse_press(rLink);
+}
+
+virtual void connect_mouse_release(const Link& 
rLink) override
+{
+gtk_widget_add_events(m_pWidget, GDK_BUTTON_RELEASE_MASK);
+GtkInstanceWidget::connect_mouse_release(rLink);
+}
+
 virtual void set_direction(bool bRTL) override
 {
 GtkInstanceWidget::set_direction(bRTL);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-22 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   16 
 vcl/unx/gtk3/gtk3gtkinst.cxx  |7 +++
 2 files changed, 23 insertions(+)

New commits:
commit 64b3ab56cbf2c48f211ad588a5d0a69d74f3bf3b
Author: Caolán McNamara 
AuthorDate: Mon Jun 22 13:02:25 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Jun 22 17:32:33 2020 +0200

move existing pages if inserting a page before an existing one

Change-Id: I661550cecab48c3173bb46c65ca4adc9ade5f927
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96860
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 3e294b4164e5..6d11b07444d0 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2234,6 +2234,8 @@ void SalInstanceNotebook::insert_page(const OString& 
rIdent, const OUString& rLa
 sal_uInt16 nPageCount = m_xNotebook->GetPageCount();
 sal_uInt16 nLastPageId = nPageCount ? m_xNotebook->GetPageId(nPageCount - 
1) : 0;
 sal_uInt16 nNewPageId = nLastPageId + 1;
+while (m_xNotebook->GetPagePos(nNewPageId) != TAB_PAGE_NOTFOUND)
+++nNewPageId;
 m_xNotebook->InsertPage(nNewPageId, rLabel, nPos == -1 ? TAB_APPEND : 
nPos);
 VclPtrInstance xPage(m_xNotebook);
 VclPtrInstance xGrid(xPage);
@@ -2244,6 +2246,13 @@ void SalInstanceNotebook::insert_page(const OString& 
rIdent, const OUString& rLa
 m_xNotebook->SetTabPage(nNewPageId, xPage);
 m_xNotebook->SetPageName(nNewPageId, rIdent);
 m_aAddedPages.try_emplace(rIdent, xPage, xGrid);
+
+if (nPos != -1)
+{
+unsigned int nPageIndex = static_cast(nPos);
+if (nPageIndex < m_aPages.size())
+m_aPages.insert(m_aPages.begin() + nPageIndex, nullptr);
+}
 }
 
 int SalInstanceNotebook::get_n_pages() const { return 
m_xNotebook->GetPageCount(); }
@@ -2360,6 +2369,13 @@ public:
 xGrid->set_hexpand(true);
 xGrid->set_vexpand(true);
 m_xNotebook->InsertPage(rIdent, rLabel, Image(), "", xGrid, nPos);
+
+if (nPos != -1)
+{
+unsigned int nPageIndex = static_cast(nPos);
+if (nPageIndex < m_aPages.size())
+m_aPages.insert(m_aPages.begin() + nPageIndex, nullptr);
+}
 }
 
 virtual int get_n_pages() const override { return 
m_xNotebook->GetPageCount(); }
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index df717239e62c..b273a7fd47f1 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -6105,6 +6105,13 @@ private:
 gtk_widget_show(pChild);
 gtk_widget_show(pTabWidget);
 
+if (nPos != -1)
+{
+unsigned int nPageIndex = static_cast(nPos);
+if (nPageIndex < m_aPages.size())
+m_aPages.insert(m_aPages.begin() + nPageIndex, nullptr);
+}
+
 enable_notify_events();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-03 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   20 
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   30 +-
 2 files changed, 41 insertions(+), 9 deletions(-)

New commits:
commit bbb9500ebf9ce5522b3c2c8e07e7fa227620dc40
Author: Caolán McNamara 
AuthorDate: Mon Mar 2 19:49:10 2020 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 3 13:02:16 2020 +0100

deem placeholders entries currently expanding as logically still 
placeholders

Change-Id: I87ebc1d7e095f465c76fcd9b76c01749fe6b57df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89871
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e4aafd793bba..f42448890b11 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -19,7 +19,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -3251,6 +3251,9 @@ private:
 VclPtr m_xTreeView;
 SvLBoxButtonData m_aCheckButtonData;
 SvLBoxButtonData m_aRadioButtonData;
+// currently expanding parent that logically, but not currently physically,
+// contain placeholders
+o3tl::sorted_vector m_aExpandingPlaceHolderParents;
 bool m_bDisableCheckBoxAutoWidth;
 int m_nSortColumn;
 
@@ -4197,6 +4200,8 @@ public:
 virtual bool get_children_on_demand(const weld::TreeIter& rIter) const 
override
 {
 const SalInstanceTreeIter& rVclIter = static_cast(rIter);
+if (m_aExpandingPlaceHolderParents.count(rVclIter.iter))
+return true;
 return GetPlaceHolderChild(rVclIter.iter) != nullptr;
 }
 
@@ -4690,14 +4695,21 @@ IMPL_LINK_NOARG(SalInstanceTreeView, ExpandingHdl, 
SvTreeListBox*, bool)
 // potentially expandable in the first place, now we remove it
 SvTreeListEntry* pPlaceHolder = GetPlaceHolderChild(pEntry);
 if (pPlaceHolder)
+{
+m_aExpandingPlaceHolderParents.insert(pEntry);
 m_xTreeView->RemoveEntry(pPlaceHolder);
+}
 
 bool bRet = signal_expanding(aIter);
 
-//expand disallowed, restore placeholder
-if (!bRet && pPlaceHolder)
+if (pPlaceHolder)
 {
-m_xTreeView->InsertEntry("", pEntry, false, 0, nullptr);
+//expand disallowed, restore placeholder
+if (!bRet)
+{
+m_xTreeView->InsertEntry("", pEntry, false, 0, nullptr);
+}
+m_aExpandingPlaceHolderParents.erase(pEntry);
 }
 
 return bRet;
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 0720a6833b57..b298bc2940cb 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -8575,6 +8575,14 @@ static GtkInstanceTreeView* g_DragSource;
 
 namespace {
 
+struct CompareGtkTreeIter
+{
+bool operator()(const GtkTreeIter& lhs, const GtkTreeIter& rhs) const
+{
+return memcmp(, , sizeof(GtkTreeIter)) < 0;
+}
+};
+
 class GtkInstanceTreeView : public GtkInstanceContainer, public virtual 
weld::TreeView
 {
 private:
@@ -8591,6 +8599,9 @@ private:
 std::map m_aWeightMap;
 // map from text column to sensitive column
 std::map m_aSensitiveMap;
+// currently expanding parent that logically, but not currently physically,
+// contain placeholders
+o3tl::sorted_vector 
m_aExpandingPlaceHolderParents;
 std::vector m_aSavedSortTypes;
 std::vector m_aSavedSortColumns;
 std::vector m_aViewColToModelCol;
@@ -8810,6 +8821,8 @@ private:
 
 bool child_is_placeholder(GtkInstanceTreeIter& rGtkIter) const
 {
+if (m_aExpandingPlaceHolderParents.count(rGtkIter.iter))
+return true;
 bool bPlaceHolder = false;
 GtkTreeModel *pModel = GTK_TREE_MODEL(m_pTreeStore);
 GtkTreeIter tmp;
@@ -8833,17 +8846,24 @@ private:
 GtkInstanceTreeIter aIter(iter);
 bool bPlaceHolder = child_is_placeholder(aIter);
 if (bPlaceHolder)
+{
 gtk_tree_store_remove(m_pTreeStore, );
+m_aExpandingPlaceHolderParents.insert(iter);
+}
 
 aIter.iter = iter;
 bool bRet = signal_expanding(aIter);
 
-//expand disallowed, restore placeholder
-if (!bRet && bPlaceHolder)
+if (bPlaceHolder)
 {
-GtkTreeIter subiter;
-OUString sDummy("");
-insert_row(subiter, , -1, nullptr, , nullptr, nullptr, 
nullptr);
+//expand disallowed, restore placeholder
+if (!bRet)
+{
+GtkTreeIter subiter;
+OUString sDummy("");
+insert_row(subiter, , -1, nullptr, , nullptr, 
nullptr, nullptr);
+}
+m_aExpandingPlaceHolderParents.erase(iter);
 }
 
 enable_notify_events();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-03 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   14 ++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   24 
 2 files changed, 38 insertions(+)

New commits:
commit 4359ee40b42a6c3febd5ff8f8286303d20d245e9
Author: Caolán McNamara 
AuthorDate: Mon Dec 2 12:56:43 2019 +
Commit: Caolán McNamara 
CommitDate: Tue Dec 3 14:44:15 2019 +0100

tdf#129068 try dialog content area help before dialog itself

we already check current notebook page before the dialog, now
check the content area before the dialog

Change-Id: Ieedb5727ddec6d24adc6e70144977b5c3063c0fd
Reviewed-on: https://gerrit.libreoffice.org/84245
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index f45f550e5985..96195407f1a0 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6589,6 +6589,20 @@ void SalInstanceWindow::help()
 OString sPageId = m_pBuilder->get_current_page_help_id();
 if (!sPageId.isEmpty())
 sHelpId = sPageId;
+else
+{
+// tdf#129068 likewise the help for the wrapping dialog is less
+// helpful than the help for the content area could be
+vcl::Window *pContentArea = nullptr;
+if (::Dialog* pDialog = 
dynamic_cast<::Dialog*>(m_xWindow.get()))
+pContentArea = pDialog->get_content_area();
+if (pContentArea)
+{
+vcl::Window* pContentWidget = 
pContentArea->GetWindow(GetWindowType::LastChild);
+if (pContentWidget)
+sHelpId = pContentWidget->GetHelpId();
+}
+}
 }
 pHelp->Start(OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), 
pSource);
 }
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index fc1e893d9633..3f7d424ee6d2 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13162,6 +13162,30 @@ void GtkInstanceWindow::help()
 OString sPageId = m_pBuilder->get_current_page_help_id();
 if (!sPageId.isEmpty())
 sHelpId = sPageId;
+else
+{
+// tdf#129068 likewise the help for the wrapping dialog is less
+// helpful than the help for the content area could be
+GtkContainer* pContainer = nullptr;
+if (GTK_IS_DIALOG(m_pWindow))
+pContainer = 
GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(m_pWindow)));
+else if (GTK_IS_ASSISTANT(m_pWindow))
+{
+GtkAssistant* pAssistant = GTK_ASSISTANT(m_pWindow);
+pContainer = 
GTK_CONTAINER(gtk_assistant_get_nth_page(pAssistant, 
gtk_assistant_get_current_page(pAssistant)));
+}
+if (pContainer)
+{
+GList* pChildren = gtk_container_get_children(pContainer);
+GList* pChild = g_list_first(pChildren);
+if (pChild)
+{
+GtkWidget* pContentWidget = 
static_cast(pChild->data);
+sHelpId = ::get_help_id(pContentWidget);
+}
+g_list_free(pChildren);
+}
+}
 }
 pHelp->Start(OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), 
pSource);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-20 Thread Caolán McNamara (via logerrit)
 vcl/source/control/wizardmachine.cxx |6 +-
 vcl/source/window/builder.cxx|   10 ++
 vcl/unx/gtk3/gtk3gtkinst.cxx |   29 +++--
 3 files changed, 34 insertions(+), 11 deletions(-)

New commits:
commit 5b20135a942328bfe5160ba2efa43b1ea9f0239c
Author: Caolán McNamara 
AuthorDate: Wed Nov 20 12:40:10 2019 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 20 15:59:12 2019 +0100

hide help buttons when LibreOfficeKit::isActive and local help unavailable

Change-Id: Ia263f9f7c78dbf48143678fc2f577402fb1ce998
Reviewed-on: https://gerrit.libreoffice.org/83304
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/control/wizardmachine.cxx 
b/vcl/source/control/wizardmachine.cxx
index cb73add6300f..cbcea92343ad 100644
--- a/vcl/source/control/wizardmachine.cxx
+++ b/vcl/source/control/wizardmachine.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -937,9 +939,11 @@ namespace vcl
 {
 m_pImpl->sTitleBase = m_xAssistant->get_title();
 
+const bool bHideHelp = comphelper::LibreOfficeKit::isActive() &&
+officecfg::Office::Common::Help::HelpRootURL::get().isEmpty();
 // create the buttons according to the wizard button flags
 // the help button
-if (nButtonFlags & WizardButtonFlags::HELP)
+if (nButtonFlags & WizardButtonFlags::HELP && !bHideHelp)
 m_xHelp->show();
 else
 m_xHelp->hide();
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 39ac93e3c820..5663a2e09989 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -13,7 +13,9 @@
 #include 
 #include 
 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -795,6 +797,14 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const 
OUString& sUIDir, const OUStr
 SAL_WARN_IF(nButtons && !bHasDefButton, "vcl.layout", "No default 
button defined in " << sUIFile);
 }
 #endif
+
+const bool bHideHelp = comphelper::LibreOfficeKit::isActive() &&
+officecfg::Office::Common::Help::HelpRootURL::get().isEmpty();
+if (bHideHelp)
+{
+if (vcl::Window *pHelpButton = get("help"))
+pHelpButton->Hide();
+}
 }
 
 VclBuilder::~VclBuilder()
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 3bc15169c01f..8b944e23432b 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -12357,6 +12358,9 @@ private:
 
 void postprocess_widget(GtkWidget* pWidget)
 {
+const bool bHideHelp = comphelper::LibreOfficeKit::isActive() &&
+officecfg::Office::Common::Help::HelpRootURL::get().isEmpty();
+
 //fixup icons
 //wanted: better way to do this, e.g. make gtk use gio for
 //loading from a filename and provide gio protocol handler
@@ -12408,16 +12412,21 @@ private:
 //set helpids
 const gchar* pStr = gtk_buildable_get_name(GTK_BUILDABLE(pWidget));
 size_t nLen = pStr ? strlen(pStr) : 0;
-if (!nLen)
-return;
-OString sHelpId = m_aUtf8HelpRoot + OString(pStr, nLen);
-set_help_id(pWidget, sHelpId);
-//hook up for extended help
-const ImplSVData* pSVData = ImplGetSVData();
-if (pSVData->maHelpData.mbBalloonHelp && !GTK_IS_DIALOG(pWidget) && 
!GTK_IS_ASSISTANT(pWidget))
-{
-gtk_widget_set_has_tooltip(pWidget, true);
-g_signal_connect(pWidget, "query-tooltip", 
G_CALLBACK(signalTooltipQuery), nullptr);
+if (nLen)
+{
+OString sBuildableName(pStr, nLen);
+OString sHelpId = m_aUtf8HelpRoot + sBuildableName;
+set_help_id(pWidget, sHelpId);
+//hook up for extended help
+const ImplSVData* pSVData = ImplGetSVData();
+if (pSVData->maHelpData.mbBalloonHelp && !GTK_IS_DIALOG(pWidget) 
&& !GTK_IS_ASSISTANT(pWidget))
+{
+gtk_widget_set_has_tooltip(pWidget, true);
+g_signal_connect(pWidget, "query-tooltip", 
G_CALLBACK(signalTooltipQuery), nullptr);
+}
+
+if (bHideHelp && sBuildableName == "help")
+gtk_widget_hide(pWidget);
 }
 
 // expand placeholder and collect potentially missing mnemonics
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-18 Thread Caolán McNamara (via logerrit)
 vcl/source/gdi/salgdilayout.cxx |2 +-
 vcl/unx/generic/gdi/salgdi.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1d552e03d9728cd4f4d2cc209eebbd77539922f8
Author: Caolán McNamara 
AuthorDate: Fri Oct 18 10:52:21 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 18 13:57:15 2019 +0200

cid#1454633 silence Uncaught exception

Change-Id: I136ebda75377f5d0391483ddc2ab9f05a01c85d9
Reviewed-on: https://gerrit.libreoffice.org/81032
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index b949e213adf4..c3c3c306d19e 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -80,7 +80,7 @@ bool SalGraphics::initWidgetDrawBackends(bool bForce)
 return false;
 }
 
-SalGraphics::~SalGraphics()
+SalGraphics::~SalGraphics() COVERITY_NOEXCEPT_FALSE
 {
 }
 
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 38dfebb2b836..083447474d11 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -89,7 +89,7 @@ X11SalGraphics::X11SalGraphics():
 
 }
 
-X11SalGraphics::~X11SalGraphics()
+X11SalGraphics::~X11SalGraphics() COVERITY_NOEXCEPT_FALSE
 {
 DeInit();
 ReleaseFonts();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-03 Thread Khaled Hosny (via logerrit)
 vcl/source/font/fontmetric.cxx |4 -
 vcl/source/fontsubset/sft.cxx  |5 +-
 vcl/unx/generic/fontmanager/fontconfig.cxx |   51 -
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |6 +-
 4 files changed, 34 insertions(+), 32 deletions(-)

New commits:
commit dcf7792da2aa2a1ef774a124f7b21f68fff0fd15
Author: Khaled Hosny 
AuthorDate: Tue Aug 27 15:19:15 2019 +0200
Commit: Khaled Hosny 
CommitDate: Tue Sep 3 23:48:17 2019 +0200

Make Noto Color Emoji font work on Linux

Noto Color Emoji is a bitmap color font, Cairo knows how to scale such
fonts and FontConfig will identify them as scalable but not outline
fonts, so change the FontConfig checks to checks for scalability.

Make sft.cxx:doOpenTTFont() accept non-outline fonts, the text will not
show in PDF but that is not worse than the status quo.

Change-Id: I756c718296d2c43e3165cd2f07b11bbb981318d3
Reviewed-on: https://gerrit.libreoffice.org/78218
Tested-by: Jenkins
Reviewed-by: Khaled Hosny 

diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx
index 72a5a77cc6fe..4da3575d7597 100644
--- a/vcl/source/font/fontmetric.cxx
+++ b/vcl/source/font/fontmetric.cxx
@@ -381,8 +381,8 @@ void 
ImplFontMetricData::ImplCalcLineSpacing(LogicalFontInstance *pFontInstance)
 if (mnAscent || mnDescent)
 mnIntLeading = mnAscent + mnDescent - mnHeight;
 
-SAL_INFO("vcl.gdi.fontmetric",
-  "fsSelection: "   << rInfo.fsSelection
+SAL_INFO("vcl.gdi.fontmetric", GetFamilyName()
+ << ": fsSelection: "   << rInfo.fsSelection
  << ", typoAscender: "  << rInfo.typoAscender
  << ", typoDescender: " << rInfo.typoDescender
  << ", typoLineGap: "   << rInfo.typoLineGap
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 47e4f7a8d7f4..52b2e0360b50 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1669,7 +1669,10 @@ static SFErrCodes doOpenTTFont( sal_uInt32 facenum, 
TrueTypeFont* t )
 /* TODO: implement to get subsetting */
 assert(t->goffsets != nullptr);
 } else {
-return SFErrCodes::TtFormat;
+// Bitmap font, accept for now.
+t->goffsets = static_cast(calloc(1+t->nglyphs, 
sizeof(sal_uInt32)));
+/* TODO: implement to get subsetting */
+assert(t->goffsets != nullptr);
 }
 
 table = getTable(t, O_hhea);
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx 
b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 3f0a2aa4418b..9fd6b380b73a 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -67,7 +67,7 @@ namespace
 
 class FontCfgWrapper
 {
-FcFontSet* m_pOutlineSet;
+FcFontSet* m_pFontSet;
 
 void addFontSet( FcSetName );
 
@@ -95,17 +95,14 @@ private:
 };
 
 FontCfgWrapper::FontCfgWrapper()
-: m_pOutlineSet( nullptr )
+: m_pFontSet( nullptr )
 {
 FcInit();
 }
 
 void FontCfgWrapper::addFontSet( FcSetName eSetName )
 {
-/*
-  add only acceptable outlined fonts to our config,
-  for future fontconfig use
-*/
+// Add only acceptable fonts to our config, for future fontconfig use.
 FcFontSet* pOrig = FcConfigGetFonts( FcConfigGetCurrent(), eSetName );
 if( !pOrig )
 return;
@@ -114,10 +111,12 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
 for( int i = 0; i < pOrig->nfont; ++i )
 {
 FcPattern* pPattern = pOrig->fonts[i];
-// #i115131# ignore non-outline fonts
-FcBool bOutline = FcFalse;
-FcResult eOutRes = FcPatternGetBool( pPattern, FC_OUTLINE, 0, 
 );
-if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
+// #i115131# ignore non-scalable fonts
+// Scalable fonts are usually outline fonts, but some bitmaps fonts
+// (like Noto Color Emoji) are also scalable.
+FcBool bScalable = FcFalse;
+FcResult eScalableRes = FcPatternGetBool(pPattern, FC_SCALABLE, 0, 
);
+if ((eScalableRes != FcResultMatch) || (bScalable == FcFalse))
 continue;
 
 // Ignore Type 1 fonts, too.
@@ -127,7 +126,7 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
 continue;
 
 FcPatternReference( pPattern );
-FcFontSetAdd( m_pOutlineSet, pPattern );
+FcFontSetAdd( m_pFontSet, pPattern );
 }
 
 // TODO?: FcFontSetDestroy( pOrig );
@@ -218,16 +217,16 @@ namespace
 
 FcFontSet* FontCfgWrapper::getFontSet()
 {
-if( !m_pOutlineSet )
+if( !m_pFontSet )
 {
-m_pOutlineSet = FcFontSetCreate();
+m_pFontSet = FcFontSetCreate();
 addFontSet( FcSetSystem );
 addFontSet( FcSetApplication );
 
-
::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont());
+

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

2019-08-23 Thread Caolán McNamara (via logerrit)
 vcl/source/window/dialog.cxx |4 ++--
 vcl/unx/gtk3/gtk3gtkinst.cxx |3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 205eb935c286f52870d7ffd9b2d8b75c2d6bc57f
Author: Caolán McNamara 
AuthorDate: Thu Aug 22 16:14:29 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 23 10:22:23 2019 +0200

an assistant might have no parent

Change-Id: Id85bfe822b68aafd4bccdbae3a4ebdc6baa6be4a
Reviewed-on: https://gerrit.libreoffice.org/77967
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 9b5f0babe06a..b6e462ba72ea 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -224,10 +224,10 @@ void Accelerator::GenerateAutoMnemonicsOnHierarchy(const 
vcl::Window* pWindow)
 if ( pWindow->GetType() == WindowType::TABPAGE )
 {
 vcl::Window* pParent = pWindow->GetParent();
-if ( pParent->GetType() == WindowType::TABCONTROL )
+if (pParent && pParent->GetType() == WindowType::TABCONTROL )
 pParent = pParent->GetParent();
 
-if ( (pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) 
== WB_DIALOGCONTROL )
+if (pParent && (pParent->GetStyle() & (WB_DIALOGCONTROL | 
WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL )
 {
 pGetChild = pParent->GetWindow( GetWindowType::FirstChild );
 while ( pGetChild )
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 4045e1c3c91c..fc0ccc8184fe 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -10916,7 +10916,8 @@ public:
 GtkAssistant* pAssistant = 
GTK_ASSISTANT(gtk_builder_get_object(m_pBuilder, id.getStr()));
 if (!pAssistant)
 return nullptr;
-gtk_window_set_transient_for(GTK_WINDOW(pAssistant), 
GTK_WINDOW(gtk_widget_get_toplevel(m_pParentWidget)));
+if (m_pParentWidget)
+gtk_window_set_transient_for(GTK_WINDOW(pAssistant), 
GTK_WINDOW(gtk_widget_get_toplevel(m_pParentWidget)));
 return std::make_unique(pAssistant, this, 
bTakeOwnership);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-16 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |8 
 vcl/unx/gtk3/gtk3gtkinst.cxx  |8 
 2 files changed, 16 deletions(-)

New commits:
commit f52d015b04779b8aaa3e353cbd9d0d5da3e73a16
Author: Caolán McNamara 
AuthorDate: Fri Aug 16 08:21:01 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 16 22:32:19 2019 +0200

get_current_page_help_id is now tried first already

Change-Id: Id7f5d2c4bcfaba68afc83d471151e1daabf1a830
Reviewed-on: https://gerrit.libreoffice.org/77558
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 90481eaf0c7e..a5a8dc8c1592 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5590,14 +5590,6 @@ void SalInstanceWidget::help_hierarchy_foreach(const 
std::functionGetParent()))
 {
-if (m_pBuilder && pParent->IsDialog())
-{
-// tdf#122355 before trying dialog help, check to see if there is 
a notebook
-// called tabcontrol, and try the help for the current page of 
that first
-OString sPageHelpId(m_pBuilder->get_current_page_help_id());
-if (!sPageHelpId.isEmpty() && func(sPageHelpId))
-return;
-}
 if (func(pParent->GetHelpId()))
 return;
 }
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index aa831c1bfbb9..97069acbb568 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -10919,14 +10919,6 @@ void GtkInstanceWidget::help_hierarchy_foreach(const 
std::functionget_current_page_help_id());
-if (!sPageHelpId.isEmpty() && func(sPageHelpId))
-return;
-}
 if (func(::get_help_id(pParent)))
 return;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-16 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   86 ++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   62 +-
 2 files changed, 97 insertions(+), 51 deletions(-)

New commits:
commit 34e83dd95260d534464ff9a61eddefdde136013c
Author: Caolán McNamara 
AuthorDate: Thu Aug 15 20:29:40 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 16 09:17:36 2019 +0200

tdf#126007 tdf#122355 online help won't look into a dialog notebook

when the focus is on the help button, offline will through the help fallback
route, but online will just fire and forget and let the server side do a
fallback, which can't know what the current notebook page was.

so bodge it to look at the notebook page right from the start if there is 
one
and its the help button itself which starts the request

Change-Id: Ida1d3101d838d99639dda12c438414c16b1ccda5
Reviewed-on: https://gerrit.libreoffice.org/77548
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 922828140e8c..3dfe6b2bd7a9 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1029,27 +1029,7 @@ public:
 return m_xWindow->GetText();
 }
 
-void help()
-{
-//show help for widget with keyboard focus
-vcl::Window* pWidget = ImplGetSVData()->maWinData.mpFocusWin;
-if (!pWidget)
-pWidget = m_xWindow;
-OString sHelpId = pWidget->GetHelpId();
-while (sHelpId.isEmpty())
-{
-pWidget = pWidget->GetParent();
-if (!pWidget)
-break;
-sHelpId = pWidget->GetHelpId();
-}
-std::unique_ptr xTemp(pWidget != m_xWindow ? new 
SalInstanceWidget(pWidget, m_pBuilder, false) : nullptr);
-weld::Widget* pSource = xTemp ? xTemp.get() : this;
-bool bRunNormalHelpRequest = !m_aHelpRequestHdl.IsSet() || 
m_aHelpRequestHdl.Call(*pSource);
-Help* pHelp = bRunNormalHelpRequest ? Application::GetHelp() : nullptr;
-if (pHelp)
-pHelp->Start(OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), 
pSource);
-}
+void help();
 
 virtual void set_busy_cursor(bool bBusy) override
 {
@@ -5526,6 +5506,17 @@ public:
 return std::make_unique();
 }
 
+OString get_current_page_help_id()
+{
+TabControl *pCtrl = get_builder().get("tabcontrol");
+TabPage* pTabPage = pCtrl ? pCtrl->GetTabPage(pCtrl->GetCurPageId()) : 
nullptr;
+vcl::Window *pTabChild = pTabPage ? 
pTabPage->GetWindow(GetWindowType::FirstChild) : nullptr;
+pTabChild = pTabChild ? 
pTabChild->GetWindow(GetWindowType::FirstChild) : nullptr;
+if (pTabChild)
+return pTabChild->GetHelpId();
+return OString();
+}
+
 virtual ~SalInstanceBuilder() override
 {
 if (VclBuilderContainer* pOwnedToplevel = 
dynamic_cast(m_aOwnedToplevel.get()))
@@ -,6 +5546,43 @@ weld::Builder* 
Application::CreateInterimBuilder(weld::Widget* pParent, const OU
 return Application::CreateInterimBuilder(pParentWidget, rUIFile);
 }
 
+void SalInstanceWindow::help()
+{
+//show help for widget with keyboard focus
+vcl::Window* pWidget = ImplGetSVData()->maWinData.mpFocusWin;
+if (!pWidget)
+pWidget = m_xWindow;
+OString sHelpId = pWidget->GetHelpId();
+while (sHelpId.isEmpty())
+{
+pWidget = pWidget->GetParent();
+if (!pWidget)
+break;
+sHelpId = pWidget->GetHelpId();
+}
+std::unique_ptr xTemp(pWidget != m_xWindow ? new 
SalInstanceWidget(pWidget, m_pBuilder, false) : nullptr);
+weld::Widget* pSource = xTemp ? xTemp.get() : this;
+bool bRunNormalHelpRequest = !m_aHelpRequestHdl.IsSet() || 
m_aHelpRequestHdl.Call(*pSource);
+Help* pHelp = bRunNormalHelpRequest ? Application::GetHelp() : nullptr;
+if (pHelp)
+{
+// tdf#126007, there's a nice fallback route for offline help where
+// the current page of a notebook will get checked when the help
+// button is pressed and there was no help for the dialog found.
+//
+// But for online help that route doesn't get taken, so bodge this here
+// by using the page help id if available and if the help button itself
+// was the original id
+if (m_pBuilder && sHelpId.endsWith("/help"))
+{
+OString sPageId = m_pBuilder->get_current_page_help_id();
+if (!sPageId.isEmpty())
+sHelpId = sPageId;
+}
+pHelp->Start(OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), 
pSource);
+}
+}
+
 //iterate upwards through the hierarchy from this widgets through its parents
 //calling func with their helpid until func returns true or we run out of 
parents
 void SalInstanceWidget::help_hierarchy_foreach(const 

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

2019-06-14 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   18 +-
 vcl/source/window/dialog.cxx  |   19 +++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   11 +--
 3 files changed, 29 insertions(+), 19 deletions(-)

New commits:
commit 7db198677d7907a1e146f0287ab742ee536f397f
Author: Caolán McNamara 
AuthorDate: Fri Jun 14 10:02:15 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 14 13:07:43 2019 +0200

broadcast up/down of welded native modal dialogs like vcl ones

Change-Id: I61519f0ff92b912501f82e31d6cc3cae244208e6
Reviewed-on: https://gerrit.libreoffice.org/74028
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 58d142217bd9..33aea3fe1419 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1071,15 +1071,11 @@ public:
 
 virtual void set_modal(bool bModal) override
 {
-if (::Dialog* pDialog = dynamic_cast<::Dialog*>(m_xWindow.get()))
-return pDialog->SetModalInputMode(bModal);
-return m_xWindow->ImplGetFrame()->SetModal(bModal);
+m_xWindow->ImplGetFrame()->SetModal(bModal);
 }
 
 virtual bool get_modal() const override
 {
-if (const ::Dialog* pDialog = dynamic_cast(m_xWindow.get()))
-return pDialog->IsModalInputMode();
 return m_xWindow->ImplGetFrame()->GetModal();
 }
 
@@ -1331,6 +1327,18 @@ public:
 m_xDialog->add_button(xButton, nResponse, true);
 }
 
+virtual void set_modal(bool bModal) override
+{
+if (get_modal() == bModal)
+return;
+m_xDialog->SetModalInputMode(bModal);
+}
+
+virtual bool get_modal() const override
+{
+return m_xDialog->IsModalInputMode();
+}
+
 virtual weld::Button* get_widget_for_response(int nResponse) override;
 
 virtual void set_default_response(int nResponse) override
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index ce83520c997a..ec660bf630b4 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -964,12 +964,6 @@ bool Dialog::ImplStartExecute()
 if ( pSVData->maWinData.mpCaptureWin )
 pSVData->maWinData.mpCaptureWin->ReleaseMouse();
 EnableInput();
-
-if ( GetParent() )
-{
-SalFrame* pFrame = GetParent()->ImplGetFrame();
-pFrame->NotifyModalHierarchy(true);
-}
 }
 
 mbInExecute = true;
@@ -1159,12 +1153,6 @@ void Dialog::EndDialog( long nResult )
 }
 }
 
-if (bModal && GetParent())
-{
-SalFrame* pFrame = GetParent()->ImplGetFrame();
-pFrame->NotifyModalHierarchy(false);
-}
-
 mpDialogImpl->mnResult = nResult;
 
 if ( mpDialogImpl->mbStartedModal )
@@ -1222,6 +1210,13 @@ void Dialog::SetModalInputMode( bool bModal )
 return;
 
 ImplGetFrame()->SetModal(bModal);
+
+if (GetParent())
+{
+SalFrame* pFrame = GetParent()->ImplGetFrame();
+pFrame->NotifyModalHierarchy(bModal);
+}
+
 ImplSetModalInputMode(bModal);
 }
 
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 42a66e69b460..d07207de5379 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2938,6 +2938,7 @@ struct DialogRunner
 {
 m_xFrameWindow->IncModalCount();
 ++m_nModalDepth;
+m_xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(true);
 }
 }
 
@@ -2947,6 +2948,7 @@ struct DialogRunner
 {
 m_xFrameWindow->DecModalCount();
 --m_nModalDepth;
+m_xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(false);
 }
 }
 
@@ -2997,13 +2999,18 @@ struct DialogRunner
 
 ~DialogRunner()
 {
-if (m_xFrameWindow)
+if (m_xFrameWindow && m_nModalDepth)
 {
 // if, like the calc validation dialog does, the modality was
 // toggled off during execution ensure that on cleanup the parent
 // is left in the state it was found
-while (m_nModalDepth++ < 0)
+SalFrame* pFrame = m_xFrameWindow->ImplGetFrame();
+do
+{
 m_xFrameWindow->IncModalCount();
+pFrame->NotifyModalHierarchy(true);
+}
+while (++m_nModalDepth < 0);
 }
 }
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-17 Thread Caolán McNamara (via logerrit)
 vcl/source/window/dialog.cxx |   18 +
 vcl/unx/gtk3/gtk3gtkinst.cxx |  141 +--
 2 files changed, 114 insertions(+), 45 deletions(-)

New commits:
commit 644ca26af744aec1e66c8dd4199d1228e0f780be
Author: Caolán McNamara 
AuthorDate: Tue May 14 21:50:36 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 17 10:59:44 2019 +0200

allow closing welded dialogs to be cancelled

from both directions of window manager close button and esc

Change-Id: I3c7bd6f67e3100f5dd3ab04456ad9aa5100c472c
Reviewed-on: https://gerrit.libreoffice.org/72319
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 21957995644e..5348e206f2c0 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -835,8 +835,26 @@ bool Dialog::Close()
 if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() && 
!IsInExecute() )
 return false;
 
+// If there's a cancel button with a custom handler, then always give it a 
chance to
+// handle Dialog::Close
+PushButton* pCustomCancelButton;
+PushButton* pCancelButton = 
dynamic_cast(get_widget_for_response(RET_CANCEL));
+if (!mbInClose && pCancelButton && pCancelButton->GetClickHdl().IsSet())
+pCustomCancelButton = pCancelButton;
+else
+pCustomCancelButton = nullptr;
+
 mbInClose = true;
 
+if (pCustomCancelButton)
+{
+pCustomCancelButton->Click();
+if (xWindow->IsDisposed())
+return true;
+mbInClose = false;
+return false;
+}
+
 if ( !(GetStyle() & WB_CLOSEABLE) )
 {
 bool bRet = true;
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index dac1bccae151..0d60969bff8d 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2995,6 +2995,8 @@ namespace
 }
 }
 
+class GtkInstanceButton;
+
 class GtkInstanceDialog : public GtkInstanceWindow, public virtual weld::Dialog
 {
 private:
@@ -3006,6 +3008,7 @@ private:
 std::function m_aFunc;
 gulong m_nCloseSignalId;
 gulong m_nResponseSignalId;
+gulong m_nSignalDeleteId;
 
 // for calc ref dialog that shrink to range selection widgets and resize 
back
 GtkWidget* m_pRefEdit;
@@ -3014,10 +3017,12 @@ private:
 int m_nOldEditWidthReq; // Original width request of the input field
 int m_nOldBorderWidth; // border width for expanded dialog
 
+void signal_close();
+
 static void signalClose(GtkWidget*, gpointer widget)
 {
 GtkInstanceDialog* pThis = static_cast(widget);
-pThis->response(RET_CANCEL);
+pThis->signal_close();
 }
 
 static void signalAsyncResponse(GtkWidget*, gint ret, gpointer widget)
@@ -3026,6 +3031,11 @@ private:
 pThis->asyncresponse(ret);
 }
 
+static gboolean signalAsyncDelete(GtkDialog*, GdkEventAny*, gpointer)
+{
+return true; /* Do not destroy */
+}
+
 static int GtkToVcl(int ret)
 {
 if (ret == GTK_RESPONSE_OK)
@@ -3043,24 +3053,7 @@ private:
 return ret;
 }
 
-void asyncresponse(gint ret)
-{
-if (ret == GTK_RESPONSE_HELP)
-{
-help();
-return;
-}
-else if (has_click_handler(ret))
-return;
-
-hide();
-m_aFunc(GtkToVcl(ret));
-m_aFunc = nullptr;
-// move the self pointer, otherwise it might be de-allocated by time 
we try to reset it
-std::shared_ptr me = std::move(m_xRunAsyncSelf);
-m_xDialogController.reset();
-me.reset();
-}
+void asyncresponse(gint ret);
 
 public:
 GtkInstanceDialog(GtkDialog* pDialog, GtkInstanceBuilder* pBuilder, bool 
bTakeOwnership)
@@ -3069,6 +3062,7 @@ public:
 , m_aDialogRun(pDialog)
 , m_nCloseSignalId(g_signal_connect(m_pDialog, "close", 
G_CALLBACK(signalClose), this))
 , m_nResponseSignalId(0)
+, m_nSignalDeleteId(0)
 , m_pRefEdit(nullptr)
 , m_nOldEditWidth(0)
 , m_nOldEditWidthReq(0)
@@ -3086,6 +3080,7 @@ public:
 show();
 
 m_nResponseSignalId = g_signal_connect(m_pDialog, "response", 
G_CALLBACK(signalAsyncResponse), this);
+m_nSignalDeleteId = g_signal_connect(m_pDialog, "delete-event", 
G_CALLBACK(signalAsyncDelete), this);
 
 return true;
 }
@@ -3100,32 +3095,14 @@ public:
 show();
 
 m_nResponseSignalId = g_signal_connect(m_pDialog, "response", 
G_CALLBACK(signalAsyncResponse), this);
+m_nSignalDeleteId = g_signal_connect(m_pDialog, "delete-event", 
G_CALLBACK(signalAsyncDelete), this);
 
 return true;
 }
 
-bool has_click_handler(int nResponse);
+GtkInstanceButton* has_click_handler(int nResponse);
 
-virtual int run() override
-{
-
sort_native_button_order(GTK_BOX(gtk_dialog_get_action_area(m_pDialog)));
-  

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

2019-03-24 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |9 -
 vcl/unx/gtk3/gtk3gtkinst.cxx  |5 +
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 3a8bf7fdf6c07cfc5df919263676fdece658aada
Author: Caolán McNamara 
AuthorDate: Sat Mar 23 20:34:52 2019 +
Commit: Caolán McNamara 
CommitDate: Sat Mar 23 22:47:11 2019 +0100

ComboBoxes have subwidgets in them, combine together for has_focus

Change-Id: Id57190ebf478641ad2a1ac79ef6a01fbb69af1ed
Reviewed-on: https://gerrit.libreoffice.org/69592
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index b645b0384ae5..6a27b64f2974 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -667,7 +667,7 @@ void SalInstanceWidget::HandleEventListener(VclWindowEvent& 
rEvent)
 bool SalInstanceWidget::HandleKeyEventListener(VclWindowEvent& rEvent)
 {
 // we get all key events here, ignore them unless we have focus
-if (!m_xWidget->HasFocus())
+if (!has_focus())
 return false;
 if (rEvent.GetId() == VclEventId::WindowKeyInput)
 {
@@ -3849,6 +3849,13 @@ public:
 return static_cast(m_xComboBox->GetEntryData(index));
 }
 
+// ComboBoxes are comprised of multiple subwidgets, consider the lot as
+// one thing for focus
+virtual bool has_focus() const override
+{
+return m_xWidget->HasChildPathFocus();
+}
+
 virtual OUString get_active_id() const override
 {
 sal_Int32 nPos = m_xComboBox->GetSelectedEntryPos();
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index e0fda96cafac..18aaf556223d 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -8369,6 +8369,11 @@ public:
 weld::Widget::connect_focus_out(rLink);
 }
 
+virtual bool has_focus() const override
+{
+return gtk_widget_has_focus(m_pToggleButton) || 
GtkInstanceWidget::has_focus();
+}
+
 virtual ~GtkInstanceComboBox() override
 {
 if (m_nAutoCompleteIdleId)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2018-12-18 Thread Libreoffice Gerrit user
 vcl/source/bitmap/bitmap.cxx |2 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 127490ec061e18f77c546069f05826184e1cea06
Author: Andrea Gelmini 
AuthorDate: Tue Dec 18 19:32:03 2018 +
Commit: Julien Nabet 
CommitDate: Wed Dec 19 08:48:31 2018 +0100

Removed useless semicolons

Change-Id: I6efd221e71020030ae5b8ac8800f72e42b13aa28
Reviewed-on: https://gerrit.libreoffice.org/65390
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index d76ae3950b4d..c26cf89c3b66 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -352,7 +352,7 @@ BitmapInfoAccess* Bitmap::AcquireInfoAccess()
 
 if( !*pInfoAccess )
 {
-return nullptr;;
+return nullptr;
 }
 
 return pInfoAccess.release();
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 1825fe9703e2..0d72b7cd41c7 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3313,7 +3313,7 @@ private:
 else
 {
 auto nMainLen = gtk_notebook_get_n_pages(m_pNotebook);
-return nOverFlowIndex + nMainLen;;
+return nOverFlowIndex + nMainLen;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-20 Thread Libreoffice Gerrit user
 vcl/source/app/salvtables.cxx|5 ++---
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx |2 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx |7 ---
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 4853640c2ef30693ddaa5f5204aabc5a671c3692
Author: Caolán McNamara 
AuthorDate: Tue Nov 20 15:13:08 2018 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 20 22:05:28 2018 +0100

coverity#1441469 silence Dereference null return value

and

coverity#1441468 Uninitialized pointer field
coverity#1441470 Uninitialized pointer field
coverity#1441467 Unchecked return value

Change-Id: I485fb0b5a83838a3c4913a74b5ea3ae70b4f6bd1
Reviewed-on: https://gerrit.libreoffice.org/63663
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 67ac7ed97986..b117e34f15d6 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1753,10 +1753,8 @@ IMPL_LINK(SalInstanceEntry, CursorListener, 
VclWindowEvent&, rEvent, void)
 struct SalInstanceTreeIter : public weld::TreeIter
 {
 SalInstanceTreeIter(const SalInstanceTreeIter* pOrig)
+: iter(pOrig ? pOrig->iter : nullptr)
 {
-if (!pOrig)
-return;
-iter = pOrig->iter;
 }
 SvTreeListEntry* iter;
 };
@@ -2160,6 +2158,7 @@ IMPL_LINK_NOARG(SalInstanceTreeView, ExpandingHdl, 
SvTreeListBox*, bool)
 if (pEntry->HasChildren())
 {
 auto pChild = m_xTreeView->FirstChild(pEntry);
+assert(pChild);
 if (m_xTreeView->GetEntryText(pChild) == "")
 {
 m_xTreeView->RemoveEntry(pChild);
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx 
b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index b4603bb32a80..2dd75d4f3166 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -1233,7 +1233,7 @@ uno::Any SalGtkFilePicker::HandleGetListValue(GtkComboBox 
*pWidget, sal_Int16 nC
 , 0, , -1);
 aItemList[i] = OUString(item, strlen(item), 
RTL_TEXTENCODING_UTF8);
 g_free(item);
-gtk_tree_model_iter_next(pTree, );
+(void)gtk_tree_model_iter_next(pTree, );
 }
 }
 aAny <<= aItemList;
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 7e613bd202d1..885669361d99 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -4129,9 +4129,10 @@ struct GtkInstanceTreeIter : public weld::TreeIter
 {
 GtkInstanceTreeIter(const GtkInstanceTreeIter* pOrig)
 {
-if (!pOrig)
-return;
-iter = pOrig->iter;
+if (pOrig)
+iter = pOrig->iter;
+else
+memset(, 0, sizeof(iter));
 }
 GtkTreeIter iter;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-27 Thread Libreoffice Gerrit user
 vcl/source/edit/textdoc.cxx  |8 
 vcl/source/edit/texteng.cxx  |   19 +--
 vcl/source/gdi/pdfwriter_impl.cxx|8 
 vcl/unx/generic/dtrans/X11_selection.cxx |6 +++---
 vcl/unx/gtk/a11y/atkwrapper.cxx  |6 --
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx |   19 +--
 6 files changed, 33 insertions(+), 33 deletions(-)

New commits:
commit 82a4ef72d6e34c2f5075069a1b353f7fd41c7595
Author: Noel Grandin 
AuthorDate: Thu Jul 26 15:04:06 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 27 11:06:44 2018 +0200

loplugin:stringloop in vcl

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

diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx
index 68fa2e8f7398..d9b540ddf86d 100644
--- a/vcl/source/edit/textdoc.cxx
+++ b/vcl/source/edit/textdoc.cxx
@@ -403,17 +403,17 @@ OUString TextDoc::GetText( const sal_Unicode* pSep ) const
 {
 sal_uInt32 nNodes = static_cast(maTextNodes.size());
 
-OUString aASCIIText;
+OUStringBuffer aASCIIText;
 const sal_uInt32 nLastNode = nNodes-1;
 for ( sal_uInt32 nNode = 0; nNode < nNodes; ++nNode )
 {
 TextNode* pNode = maTextNodes[ nNode ].get();
-aASCIIText += pNode->GetText();
+aASCIIText.append(pNode->GetText());
 if ( pSep && ( nNode != nLastNode ) )
-aASCIIText += pSep;
+aASCIIText.append(pSep);
 }
 
-return aASCIIText;
+return aASCIIText.makeStringAndClear();
 }
 
 OUString TextDoc::GetText( sal_uInt32 nPara ) const
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 17e1fe0de42e..3205651c6f05 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -262,7 +262,7 @@ OUString TextEngine::GetText( LineEnd aSeparator ) const
 
 OUString TextEngine::GetTextLines( LineEnd aSeparator ) const
 {
-OUString aText;
+OUStringBuffer aText;
 const sal_uInt32 nParas = mpTEParaPortions->Count();
 const sal_Unicode* pSep = static_getLineEndText( aSeparator );
 for ( sal_uInt32 nP = 0; nP < nParas; ++nP )
@@ -273,12 +273,12 @@ OUString TextEngine::GetTextLines( LineEnd aSeparator ) 
const
 for ( size_t nL = 0; nL < nLines; ++nL )
 {
 TextLine& rLine = pTEParaPortion->GetLines()[nL];
-aText += pTEParaPortion->GetNode()->GetText().copy( 
rLine.GetStart(), rLine.GetEnd() - rLine.GetStart() );
+aText.append( pTEParaPortion->GetNode()->GetText().copy( 
rLine.GetStart(), rLine.GetEnd() - rLine.GetStart() ) );
 if ( pSep && ( ( (nP+1) < nParas ) || ( (nL+1) < nLines ) ) )
-aText += pSep;
+aText.append(pSep);
 }
 }
-return aText;
+return aText.makeStringAndClear();
 }
 
 OUString TextEngine::GetText( sal_uInt32 nPara ) const
@@ -393,14 +393,13 @@ void TextEngine::ImpInitDoc()
 
 OUString TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) 
const
 {
-OUString aText;
-
 if ( !rSel.HasRange() )
-return aText;
+return OUString();
 
 TextSelection aSel( rSel );
 aSel.Justify();
 
+OUStringBuffer aText;
 const sal_uInt32 nStartPara = aSel.GetStart().GetPara();
 const sal_uInt32 nEndPara = aSel.GetEnd().GetPara();
 const sal_Unicode* pSep = static_getLineEndText( aSeparator );
@@ -415,11 +414,11 @@ OUString TextEngine::GetText( const TextSelection& rSel, 
LineEnd aSeparator ) co
 if ( nNode == nEndPara ) // may also be == nStart!
 nEndPos = aSel.GetEnd().GetIndex();
 
-aText += pNode->GetText().copy( nStartPos, nEndPos-nStartPos );
+aText.append(pNode->GetText().copy( nStartPos, nEndPos-nStartPos ));
 if ( nNode < nEndPara )
-aText += pSep;
+aText.append(pSep);
 }
-return aText;
+return aText.makeStringAndClear();
 }
 
 void TextEngine::ImpRemoveText()
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index b7b5546acafc..85d71d4c7844 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -9160,14 +9160,14 @@ OString 
PDFWriterImpl::copyExternalResources(filter::PDFObjectElement& rPage, co
 }
 
 // Build the dictionary entry string.
-OString sRet = "/" + rKind + "<<";
+OStringBuffer sRet("/" + rKind + "<<");
 for (const auto& rPair : aRet)
 {
-sRet += "/" + rPair.first + " " + OString::number(rPair.second) + " 0 
R";
+sRet.append("/").append(rPair.first).append(" 
").append(OString::number(rPair.second)).append(" 0 R");
 }
-sRet += ">>";
+sRet.append(">>");
 
-return sRet;
+return sRet.makeStringAndClear();
 }
 
 void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
diff --git 

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

2018-07-16 Thread Libreoffice Gerrit user
 vcl/source/edit/textdata.cxx |   13 ++---
 vcl/source/edit/textdoc.cxx  |4 ++--
 vcl/source/edit/textundo.cxx |   20 ++--
 vcl/source/edit/vclmedit.cxx |9 +++--
 vcl/source/filter/igif/decode.cxx|   24 +++-
 vcl/source/filter/igif/decode.hxx|   10 +-
 vcl/source/gdi/impvect.cxx   |   12 +---
 vcl/source/window/menufloatingwindow.cxx |   27 +--
 vcl/source/window/winproc.cxx|8 
 vcl/unx/generic/print/bitmap_gfx.cxx |   22 +-
 vcl/win/gdi/salfont.cxx  |2 +-
 11 files changed, 69 insertions(+), 82 deletions(-)

New commits:
commit 311131fca0242e9465f03b6b1267906790a385c8
Author: Jochen Nitschke 
AuthorDate: Mon Jul 16 09:53:56 2018 +0200
Commit: Jochen Nitschke 
CommitDate: Mon Jul 16 11:22:30 2018 +0200

cppcheck: useInitializationList in vcl

reorder members of GIFLZWDecompressor to ease initialization.
use rtl_allocateZeroMemory in ImplVectMap to avoid memset in ctor.

Change-Id: Icfcfe73ec7e52988036995d8dbc604361aee893b
Reviewed-on: https://gerrit.libreoffice.org/57481
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Jochen Nitschke 

diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx
index 6f048175b5f2..95136829cdbe 100644
--- a/vcl/source/edit/textdata.cxx
+++ b/vcl/source/edit/textdata.cxx
@@ -266,9 +266,9 @@ TEParaPortions::~TEParaPortions()
 }
 
 IdleFormatter::IdleFormatter()
+: mpView(nullptr)
+, mnRestarts(0)
 {
-mpView = nullptr;
-mnRestarts = 0;
 SetPriority(TaskPriority::HIGH_IDLE);
 }
 
@@ -314,12 +314,11 @@ TextHint::TextHint( SfxHintId Id, sal_uLong nValue ) : 
SfxHint( Id ), mnValue(nV
 }
 
 TEIMEInfos::TEIMEInfos( const TextPaM& rPos, const OUString& 
rOldTextAfterStartPos )
-: aOldTextAfterStartPos( rOldTextAfterStartPos )
+: aOldTextAfterStartPos(rOldTextAfterStartPos)
+, aPos(rPos)
+, nLen(0)
+, bWasCursorOverwrite(false)
 {
-aPos = rPos;
-nLen = 0;
-pAttribs = nullptr;
-bWasCursorOverwrite = false;
 }
 
 TEIMEInfos::~TEIMEInfos()
diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx
index 52cb9562cdb8..68fa2e8f7398 100644
--- a/vcl/source/edit/textdoc.cxx
+++ b/vcl/source/edit/textdoc.cxx
@@ -43,8 +43,8 @@ TextCharAttrib::TextCharAttrib( const TextCharAttrib& 
rTextCharAttrib )
 }
 
 TextCharAttribList::TextCharAttribList()
+: mbHasEmptyAttribs(false)
 {
-mbHasEmptyAttribs = false;
 }
 
 TextCharAttribList::~TextCharAttribList()
@@ -380,8 +380,8 @@ void TextNode::Append( const TextNode& rNode )
 }
 
 TextDoc::TextDoc()
+: mnLeftMargin(0)
 {
-mnLeftMargin = 0;
 };
 
 TextDoc::~TextDoc()
diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx
index e5b3d0165517..724745cf08d0 100644
--- a/vcl/source/edit/textundo.cxx
+++ b/vcl/source/edit/textundo.cxx
@@ -135,11 +135,11 @@ void TextUndo::SetSelection( const TextSelection& rSel )
 }
 
 TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, 
sal_uInt32 nPara )
-: TextUndo( pTextEngine )
+: TextUndo( pTextEngine )
+, mbDelObject( true)
+, mnPara( nPara )
+, mpNode( pNode )
 {
-mpNode = pNode;
-mnPara = nPara;
-mbDelObject = true;
 }
 
 TextUndoDelPara::~TextUndoDelPara()
@@ -187,10 +187,10 @@ OUString TextUndoDelPara::GetComment () const
 }
 
 TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, 
sal_uInt32 nPara, sal_Int32 nPos )
-:   TextUndo( pTextEngine )
+: TextUndo( pTextEngine )
+, mnPara( nPara )
+, mnSepPos( nPos )
 {
-mnPara = nPara;
-mnSepPos = nPos;
 }
 
 TextUndoConnectParas::~TextUndoConnectParas()
@@ -215,10 +215,10 @@ OUString TextUndoConnectParas::GetComment () const
 }
 
 TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uInt32 
nPara, sal_Int32 nPos )
-: TextUndo( pTextEngine )
+: TextUndo( pTextEngine )
+, mnPara( nPara )
+, mnSepPos ( nPos )
 {
-mnPara = nPara;
-mnSepPos = nPos;
 }
 
 TextUndoSplitPara::~TextUndoSplitPara()
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 18a48eddb933..e9629d7f9967 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -105,13 +105,10 @@ public:
 };
 
 ImpVclMEdit::ImpVclMEdit( VclMultiLineEdit* pEdt, WinBits nWinStyle )
-:mpHScrollBar(nullptr)
-,mpVScrollBar(nullptr)
-,mpScrollBox(nullptr)
+: pVclMultiLineEdit(pEdt)
+, mpTextWindow(VclPtr::Create(pEdt))
+, mnTextWidth(0)
 {
-pVclMultiLineEdit = pEdt;
-mnTextWidth = 0;
-mpTextWindow = VclPtr::Create( pEdt );
 mpTextWindow->Show();
 InitFromStyle( nWinStyle );
 StartListening( *mpTextWindow->GetTextEngine() );
diff --git 

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

2018-03-26 Thread Caolán McNamara
 vcl/source/window/layout.cxx |8 
 vcl/unx/gtk3/gtk3gtkinst.cxx |8 
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit ef4e7c2eb5b63abc30221e75d9b9c4437aa8e00b
Author: Caolán McNamara 
Date:   Mon Mar 26 12:05:58 2018 +0100

gtk3: improve cancel, no, yes order

keep order "discard, cancel, save" but don't end up with "no, cancel, "yes",
instead have "cancel", "no", yes"

Change-Id: I7c3681b28a462e65942f5174ef386ecc2e6ee903
Reviewed-on: https://gerrit.libreoffice.org/51871
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 3a01fa7611f6..2032cd433a98 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -833,11 +833,11 @@ static int getButtonPriority(const OString )
 static const ButtonOrder aDiscardCancelSave[N_TYPES] =
 {
 { "/discard", 0 },
-{ "/no", 0 },
 { "/cancel", 1 },
-{ "/save", 2 },
-{ "/yes", 2 },
-{ "/ok", 2 }
+{ "/no", 2 },
+{ "/save", 3 },
+{ "/yes", 3 },
+{ "/ok", 3 }
 };
 
 static const ButtonOrder aSaveDiscardCancel[N_TYPES] =
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index c5ba7be58909..7ab817b0cdd6 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1490,11 +1490,11 @@ namespace
 static const ButtonOrder aDiscardCancelSave[N_TYPES] =
 {
 { "/discard", 0 },
-{ "/no", 0 },
 { "/cancel", 1 },
-{ "/save", 2 },
-{ "/yes", 2 },
-{ "/ok", 2 }
+{ "/no", 2 },
+{ "/save", 3 },
+{ "/yes", 3 },
+{ "/ok", 3 }
 };
 
 static const ButtonOrder aSaveDiscardCancel[N_TYPES] =
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-28 Thread Caolán McNamara
 vcl/source/app/salvtables.cxx |3 +
 vcl/source/window/layout.cxx  |6 ++-
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   74 ++
 3 files changed, 81 insertions(+), 2 deletions(-)

New commits:
commit c456ce855ac1ee4775489485f9107bd43a0f1371
Author: Caolán McNamara 
Date:   Tue Feb 27 16:45:44 2018 +

use ok, cancel under kde vs cancel, ok under gnome

for the native welded dialogs

Change-Id: I34663616826c1eb084262ea1c830f8580785d50c
Reviewed-on: https://gerrit.libreoffice.org/50458
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index d2f648a696c1..a2b5b13d15fc 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -404,6 +404,9 @@ public:
 
 virtual int run() override
 {
+VclButtonBox* pActionArea = m_xDialog->get_action_area();
+if (pActionArea)
+   pActionArea->sort_native_button_order();
 return m_xDialog->Execute();
 }
 
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index ae3663c9c75f..2839ab356385 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -829,20 +829,22 @@ struct ButtonOrder
 
 static int getButtonPriority(const OString )
 {
-static const size_t N_TYPES = 5;
+static const size_t N_TYPES = 6;
 static const ButtonOrder aDiscardCancelSave[N_TYPES] =
 {
 { "/discard", 0 },
 { "/no", 0 },
 { "/cancel", 1 },
 { "/save", 2 },
-{ "/yes", 2 }
+{ "/yes", 2 },
+{ "/ok", 2 }
 };
 
 static const ButtonOrder aSaveDiscardCancel[N_TYPES] =
 {
 { "/save", 0 },
 { "/yes", 0 },
+{ "/ok", 0 },
 { "/discard", 1 },
 { "/no", 1 },
 { "/cancel", 2 }
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index e31606fffbad..c36895fffce1 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1378,6 +1378,79 @@ public:
 }
 };
 
+namespace
+{
+struct ButtonOrder
+{
+OString m_aType;
+int m_nPriority;
+};
+
+int getButtonPriority(const OString )
+{
+static const size_t N_TYPES = 6;
+static const ButtonOrder aDiscardCancelSave[N_TYPES] =
+{
+{ "/discard", 0 },
+{ "/no", 0 },
+{ "/cancel", 1 },
+{ "/save", 2 },
+{ "/yes", 2 },
+{ "/ok", 2 }
+};
+
+static const ButtonOrder aSaveDiscardCancel[N_TYPES] =
+{
+{ "/save", 0 },
+{ "/yes", 0 },
+{ "/ok", 0 },
+{ "/discard", 1 },
+{ "/no", 1 },
+{ "/cancel", 2 }
+};
+
+const ButtonOrder* pOrder = [0];
+
+const OUString  = Application::GetDesktopEnvironment();
+
+if (rEnv.equalsIgnoreAsciiCase("windows") ||
+rEnv.equalsIgnoreAsciiCase("tde") ||
+rEnv.startsWithIgnoreAsciiCase("kde"))
+{
+pOrder = [0];
+}
+
+for (size_t i = 0; i < N_TYPES; ++i, ++pOrder)
+{
+if (rType.endsWith(pOrder->m_aType))
+return pOrder->m_nPriority;
+}
+
+return -1;
+}
+
+bool sortButtons(const GtkWidget* pA, const GtkWidget* pB)
+{
+//order within groups according to platform rules
+return getButtonPriority(::get_help_id(pA)) < 
getButtonPriority(::get_help_id(pB));
+}
+
+void sort_native_button_order(GtkBox* pContainer)
+{
+std::vector aChildren;
+GList* pChildren = 
gtk_container_get_children(GTK_CONTAINER(pContainer));
+for (GList* pChild = g_list_first(pChildren); pChild; pChild = 
g_list_next(pChild))
+aChildren.push_back(static_cast(pChild->data));
+g_list_free(pChildren);
+
+//sort child order within parent so that we match the platform button 
order
+std::stable_sort(aChildren.begin(), aChildren.end(), sortButtons);
+
+for (size_t pos = 0; pos < aChildren.size(); ++pos)
+gtk_box_reorder_child(pContainer, aChildren[pos], pos);
+}
+}
+
 class GtkInstanceDialog : public GtkInstanceWindow, public virtual weld::Dialog
 {
 private:
@@ -1399,6 +1472,7 @@ public:
 
 virtual int run() override
 {
+
sort_native_button_order(GTK_BOX(gtk_dialog_get_action_area(m_pDialog)));
 int ret;
 while (true)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/source vcl/unx vcl/win vcl/workben

2018-01-31 Thread Julien Nabet
 vcl/source/window/window.cxx   |   14 --
 vcl/source/window/window2.cxx  |4 
 vcl/unx/generic/app/saldisp.cxx|4 
 vcl/unx/generic/dtrans/X11_selection.cxx   |   71 ---
 vcl/unx/generic/fontmanager/fontconfig.cxx |   22 +--
 vcl/unx/generic/fontmanager/fontmanager.cxx|   34 ++---
 vcl/unx/generic/gdi/gcach_xpeer.cxx|   10 -
 vcl/unx/generic/gdi/gdiimpl.cxx|   10 -
 vcl/unx/generic/gdi/salgdi.cxx |4 
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |8 -
 vcl/unx/generic/glyphs/glyphcache.cxx  |8 -
 vcl/unx/generic/print/genprnpsp.cxx|6 
 vcl/unx/generic/print/genpspgraphics.cxx   |   14 +-
 vcl/unx/generic/print/glyphset.cxx |   36 ++---
 vcl/unx/generic/print/text_gfx.cxx |   13 +-
 vcl/unx/generic/printer/cpdmgr.cxx |   34 ++---
 vcl/unx/generic/printer/ppdparser.cxx  |   49 +++
 vcl/unx/generic/printer/printerinfomanager.cxx |  161 -
 vcl/unx/gtk/gtksys.cxx |   14 +-
 vcl/unx/gtk/salnativewidgets-gtk.cxx   |  148 +++---
 vcl/win/gdi/gdiimpl.cxx|   26 ++--
 vcl/win/window/salframe.cxx|4 
 vcl/workben/vcldemo.cxx|8 -
 23 files changed, 345 insertions(+), 357 deletions(-)

New commits:
commit 8b700053cf1b91fbc728cb0b69b6efe21ab61248
Author: Julien Nabet 
Date:   Wed Jan 31 11:49:59 2018 +0100

Modernize a bit vcl (part5)

by using for range loops

Change-Id: I52d6e6c9e1c2c321dc81d8258943a1a9a611441c
Reviewed-on: https://gerrit.libreoffice.org/48987
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index aedd405f1c04..22471ada2ff8 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -387,9 +387,9 @@ void Window::dispose()
 
 // clear mnemonic labels
 std::vector aMnemonicLabels(list_mnemonic_labels());
-for (auto aI = aMnemonicLabels.begin(); aI != aMnemonicLabels.end(); ++aI)
+for (auto const& mnemonicLabel : aMnemonicLabels)
 {
-remove_mnemonic_label(*aI);
+remove_mnemonic_label(mnemonicLabel);
 }
 
 // hide window in order to trigger the Paint-Handling
@@ -2587,18 +2587,16 @@ void Window::EnableInput( bool bEnable, const 
vcl::Window* pExcludeWindow )
 if( mpWindowImpl->mbFrame )
 {
 ::std::vector< VclPtr >& rList = 
mpWindowImpl->mpFrameData->maOwnerDrawList;
-auto p = rList.begin();
-while( p != rList.end() )
+for (auto const& elem : rList)
 {
 // Is Window in the path from this window
-if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), true 
) )
+if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( elem, true 
) )
 {
 // Is Window not in the exclude window path or not the
 // exclude window, than change the status
-if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( 
(*p), true ) )
-(*p)->EnableInput( bEnable );
+if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( 
elem, true ) )
+elem->EnableInput( bEnable );
 }
-++p;
 }
 }
 }
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 997581a6d320..85b72726ebc2 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1669,9 +1669,9 @@ Size Window::get_preferred_size() const
 {
 const bool bIgnoreInHidden = 
pWindowImpl->m_xSizeGroup->get_ignore_hidden();
 const std::set  = 
pWindowImpl->m_xSizeGroup->get_widgets();
-for (auto aI = rWindows.begin(), aEnd = rWindows.end(); aI != 
aEnd; ++aI)
+for (auto const& window : rWindows)
 {
-const vcl::Window *pOther = *aI;
+const vcl::Window *pOther = window;
 if (pOther == this)
 continue;
 if (bIgnoreInHidden && !pOther->IsVisible())
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index edf8ca53246f..a8fb3c542a64 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -2307,8 +2307,8 @@ void SalDisplay::InitXinerama()
 #if OSL_DEBUG_LEVEL > 1
 if( m_bXinerama )
 {
-for( std::vector< Rectangle >::const_iterator it = 
m_aXineramaScreens.begin(); it != m_aXineramaScreens.end(); ++it )
-fprintf( stderr, "Xinerama screen: %ldx%ld+%ld+%ld\n", 
it->GetWidth(), it->GetHeight(), it->Left(), it->Top() );
+for (auto const& screen : m_aXineramaScreens)
+

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

2018-01-10 Thread Katarina Behrens
 vcl/source/gdi/print3.cxx  |3 +++
 vcl/source/window/printdlg.cxx |1 +
 vcl/unx/generic/print/prtsetup.cxx |6 --
 3 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 0a50357ded3293bda08b9a68b53ee71164cd49a1
Author: Katarina Behrens 
Date:   Mon Jan 8 13:45:43 2018 +0100

tdf#79077: Harmonize PapersizeFromSetup checkboxes in printer config

job setup and options tab page. Also fix a small UI regression

Change-Id: I48532ac4e188d68008e947924da651239262d8b2
Reviewed-on: https://gerrit.libreoffice.org/47703
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 43485921e7b0..4aef505fc7c1 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -322,6 +322,7 @@ bool 
Printer::PreparePrintJob(std::shared_ptr xController,
 VclPtrInstance xPrinter( aPrinterName );
 xPrinter->SetJobSetup(i_rInitSetup);
 xController->setPrinter(xPrinter);
+
xController->setPapersizeFromSetup(xPrinter->GetPrinterSettingsPreferred());
 }
 
 // reset last page property
@@ -822,6 +823,7 @@ bool PrinterController::setupPrinter( vcl::Window* 
i_pParent )
 if (bRet)
 {
 bool bInvalidateCache = false;
+setPapersizeFromSetup(xPrinter->GetPrinterSettingsPreferred());
 
 // was papersize overridden ? if so we need to take action if we're
 // configured to use the driver papersize
@@ -1354,6 +1356,7 @@ bool PrinterController::getReversePrint() const
 void PrinterController::setPapersizeFromSetup( bool i_bPapersizeFromSetup )
 {
 mpImplData->mbPapersizeFromSetup = i_bPapersizeFromSetup;
+mpImplData->mxPrinter->SetPrinterSettingsPreferred( i_bPapersizeFromSetup 
);
 }
 
 bool PrinterController::getPapersizeFromSetup() const
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 6979dc0c8efa..b3f2639d9251 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -674,6 +674,7 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const 
std::shared_ptrSetClickHdl( LINK( this, PrintDialog, ClickHdl ) 
);
 maNUpPage.mpBorderCB->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
 maOptionsPage.mpPapersizeFromSetup->SetToggleHdl( LINK( this, PrintDialog, 
ToggleHdl ) );
+maOptionsPage.mpPapersizeFromSetup->Check( 
maPController->getPapersizeFromSetup() );
 maJobPage.mpReverseOrderBox->SetToggleHdl( LINK( this, PrintDialog, 
ToggleHdl ) );
 maOptionsPage.mpCollateSingleJobsBox->SetToggleHdl( LINK( this, 
PrintDialog, ToggleHdl ) );
 maNUpPage.mpPagesBtn->SetToggleHdl( LINK( this, PrintDialog, 
ToggleRadioHdl ) );
diff --git a/vcl/unx/generic/print/prtsetup.cxx 
b/vcl/unx/generic/print/prtsetup.cxx
index 49489099158e..3e75b9907e1e 100644
--- a/vcl/unx/generic/print/prtsetup.cxx
+++ b/vcl/unx/generic/print/prtsetup.cxx
@@ -132,8 +132,8 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton, void )
 orientation::Portrait : orientation::Landscape;
 // assume use of paper size from printer setup if the user
 // got here via File > Printer Settings ...
-m_aJobData.m_bPapersizeFromSetup =
-( m_aJobData.meSetupMode == PrinterSetupMode::DocumentGlobal );
+if ( m_aJobData.meSetupMode == PrinterSetupMode::DocumentGlobal )
+   m_aJobData.m_bPapersizeFromSetup = true;
 }
 if( m_pDevicePage )
 {
@@ -306,7 +306,9 @@ IMPL_LINK( RTSPaperPage, CheckBoxHdl, CheckBox&, /*cBox*/, 
void )
 {
 bool bFromSetup = m_pCbFromSetup->IsChecked();
 m_pParent->m_aJobData.m_bPapersizeFromSetup = bFromSetup;
+m_pPaperText->Enable( bFromSetup );
 m_pPaperBox->Enable( bFromSetup );
+m_pOrientText->Enable( bFromSetup );
 m_pOrientBox->Enable( bFromSetup );
 m_pParent->SetDataModified( true );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-06-15 Thread Caolán McNamara
 vcl/source/app/svmain.cxx |   18 +-
 vcl/unx/gtk/gtkinst.cxx   |6 --
 2 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit 9eb919628fce98b5e7a8b3262d76a8b0e8cc01c4
Author: Caolán McNamara 
Date:   Tue May 30 12:27:08 2017 +0100

make LANGUAGE setting universal, not just gtk specific

Change-Id: I845e808be27e2fad959a73d0d34a204b4bdcdd1f
Reviewed-on: https://gerrit.libreoffice.org/38211
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 2a89d80f60f3..672618bd5712 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -313,10 +313,26 @@ bool InitVCL()
 new DesktopEnvironmentContext( css::uno::getCurrentContext() ) );
 
 // Initialize application instance (should be done after initialization of 
VCL SAL part)
-if( pSVData->mpApp )
+if (pSVData->mpApp)
+{
 // call init to initialize application class
 // soffice/sfx implementation creates the global service manager
 pSVData->mpApp->Init();
+}
+
+if (pSVData->maAppData.mpSettings)
+{
+//Now that uno has been bootstrapped we can ask the config what the UI 
language is so that we can
+//force that in as $LANGUAGE. That way we can get gtk to render 
widgets RTL
+//if we have a RTL UI in an otherwise LTR locale and get gettext using 
externals (e.g. python)
+//to match their translations to our preferred UI language
+OUString 
aLocaleString(pSVData->maAppData.mpSettings->GetUILanguageTag().getGlibcLocaleString(".UTF-8"));
+if (!aLocaleString.isEmpty())
+{
+OUString envVar("LANGUAGE");
+osl_setEnvironment(envVar.pData, aLocaleString.pData);
+}
+}
 
 pSVData->mpDefInst->AfterAppInit();
 
diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx
index e01a267b6131..a22ea9c93f87 100644
--- a/vcl/unx/gtk/gtkinst.cxx
+++ b/vcl/unx/gtk/gtkinst.cxx
@@ -167,12 +167,6 @@ GtkInstance::GtkInstance( SalYieldMutex* pMutex )
 //UI in a LTR locale
 void GtkInstance::AfterAppInit()
 {
-OUString 
aLocaleString(Application::GetSettings().GetUILanguageTag().getGlibcLocaleString(".UTF-8"));
-if (!aLocaleString.isEmpty())
-{
-OUString envVar("LANGUAGE");
-osl_setEnvironment(envVar.pData, aLocaleString.pData);
-}
 EnsureInit();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-30 Thread Caolán McNamara
 vcl/source/app/svmain.cxx |   11 ---
 vcl/unx/gtk/gtkinst.cxx   |6 ++
 2 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit d412e969e103253bbc74df8ead9fe3d67ddb53a0
Author: Caolán McNamara 
Date:   Tue May 30 12:22:00 2017 +0100

Revert "make LANGUAGE setting universal, not just gtk specific"

poxy cppunit tests can't use config here

This reverts commit f55eeb7a45998d16eb0fe49088e172ce45ac4f2b.

diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 0e0a2a9bbbff..2a89d80f60f3 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -318,17 +318,6 @@ bool InitVCL()
 // soffice/sfx implementation creates the global service manager
 pSVData->mpApp->Init();
 
-//Now that uno has been bootstrapped we can ask the config what the UI 
language is so that we can
-//force that in as $LANGUAGE. That way we can get gtk to render widgets RTL
-//if we have a RTL UI in an otherwise LTR locale and get gettext using 
externals (e.g. python)
-//to match their translations to our preferred UI language
-OUString 
aLocaleString(Application::GetSettings().GetUILanguageTag().getGlibcLocaleString(".UTF-8"));
-if (!aLocaleString.isEmpty())
-{
-OUString envVar("LANGUAGE");
-osl_setEnvironment(envVar.pData, aLocaleString.pData);
-}
-
 pSVData->mpDefInst->AfterAppInit();
 
 // Fetch AppFileName and make it absolute before the workdir changes...
diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx
index a22ea9c93f87..e01a267b6131 100644
--- a/vcl/unx/gtk/gtkinst.cxx
+++ b/vcl/unx/gtk/gtkinst.cxx
@@ -167,6 +167,12 @@ GtkInstance::GtkInstance( SalYieldMutex* pMutex )
 //UI in a LTR locale
 void GtkInstance::AfterAppInit()
 {
+OUString 
aLocaleString(Application::GetSettings().GetUILanguageTag().getGlibcLocaleString(".UTF-8"));
+if (!aLocaleString.isEmpty())
+{
+OUString envVar("LANGUAGE");
+osl_setEnvironment(envVar.pData, aLocaleString.pData);
+}
 EnsureInit();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/source vcl/unx winaccessibility/source writerfilter/source

2017-03-11 Thread Andrea Gelmini
 vcl/source/window/tabdlg.cxx   |2 +-
 vcl/unx/kde4/KDEXLib.cxx   |2 +-
 winaccessibility/source/UAccCOMIDL/ia2_api_all.idl |2 +-
 winaccessibility/source/service/AccObject.cxx  |2 +-
 writerfilter/source/dmapper/DomainMapper.cxx   |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 9dde2f019363e2d35c320b33306bff9a65118ee5
Author: Andrea Gelmini 
Date:   Sat Mar 11 00:57:24 2017 +0100

Fix typos

Change-Id: I2be7113bfe86476acfd6550f1eed53eed83c9747
Reviewed-on: https://gerrit.libreoffice.org/35063
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 4b4cb46..5fb80a3 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -298,7 +298,7 @@ std::vector 
TabDialog::getAllPageUIXMLDescriptions() const
 // we have to check for double entries, this may 
happen e.g.
 // in the HeaderFooterDialog which has two times the 
same
 // tabPage added. Add the PageID as hint to the name, 
separated
-// by a token (using "|" here). Do not do this for 1st 
ocurrence,
+// by a token (using "|" here). Do not do this for 1st 
occurrence,
 // that is used for detection and is not necessary.
 // Use the UIXMLDescription without trailing '.ui', 
with one trailing '/'
 bool bAlreadyAdded(false);
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 1041373..a1dea73 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -345,7 +345,7 @@ void KDEXLib::StopTimer()
 void KDEXLib::timeoutActivated()
 {
 // HACK? Always process posted events before timer timeouts.
-// There are places that may watch both both (for example, there's a posted
+// There are places that may watch both (for example, there's a posted
 // event about change of the current active window and there's a timeout
 // event informing that a document has finished loading). This is of course
 // racy, but both generic and gtk event loops manage to deliver posted 
events
diff --git a/winaccessibility/source/UAccCOMIDL/ia2_api_all.idl 
b/winaccessibility/source/UAccCOMIDL/ia2_api_all.idl
index 34b61c2..f2de749 100644
--- a/winaccessibility/source/UAccCOMIDL/ia2_api_all.idl
+++ b/winaccessibility/source/UAccCOMIDL/ia2_api_all.idl
@@ -3789,7 +3789,7 @@ interface IAccessibleHypertext2 : IAccessibleHypertext
   where cells are direct children of the table.
 
  The range of valid coordinates for this interface are implementation 
dependent.
-  However, that range includes at least the intervals from the from the first 
row
+  However, that range includes at least the intervals from the first row
   or column with the index 0 up to the last (but not including) used row or 
column
   as returned by IAccessibleTable::nRows and IAccessibleTable::nColumns.
 
diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 4fcc580..b5134c5 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -776,7 +776,7 @@ void AccObject::UpdateActionDesc()
   Role == EDIT_BAR || Role == PASSWORD_TEXT || Role == 
TEXT))
 {
 pXString = 
m_xAccActionRef->getAccessibleActionDescription( 0 );
-//Solution:If string length is more than zero,action will 
will be set.
+//Solution: if string length is more than zero, action is 
set.
 if( pXString.getLength() > 0)
 m_pIMAcc->Put_ActionDescription( pXString.getStr() );
 }
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index a3f9923..8c42966 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -667,7 +667,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 //TODO: attributes for break (0x12) are not supported
 break;
 case NS_ooxml::LN_CT_Fonts_hint :
-/*  assigns script type to ambigous characters, values can be:
+/*  assigns script type to ambiguous characters, values can be:
 NS_ooxml::LN_Value_ST_Hint_default
 NS_ooxml::LN_Value_ST_Hint_eastAsia
 NS_ooxml::LN_Value_ST_Hint_cs
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-03-08 Thread Stephan Bergmann
 vcl/source/control/field.cxx |2 
 vcl/source/edit/vclmedit.cxx |2 
 vcl/source/filter/wmf/enhwmf.cxx |2 
 vcl/source/filter/wmf/winmtf.cxx |2 
 vcl/source/filter/wmf/winwmf.cxx |2 
 vcl/source/fontsubset/sft.cxx|6 +-
 vcl/source/gdi/graph.cxx |8 +--
 vcl/source/gdi/pngread.cxx   |   12 ++--
 vcl/source/gdi/print.cxx |2 
 vcl/source/window/accel.cxx  |2 
 vcl/source/window/splitwin.cxx   |   78 +--
 vcl/unx/generic/dtrans/X11_selection.cxx |8 ++-
 vcl/unx/generic/window/FWS.cxx   |3 -
 vcl/unx/kde4/KDEXLib.cxx |5 -
 14 files changed, 62 insertions(+), 72 deletions(-)

New commits:
commit 8ac16e14f4a77b98716f059c51a4fe5dce6ef440
Author: Stephan Bergmann 
Date:   Wed Mar 8 14:26:12 2017 +0100

loplugin:loopvartoosmall

Change-Id: Ie173849c0956edf9fd20fa4bdfb2930ab69f

diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index d0fc826..394fb8f 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -271,7 +271,7 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& 
rValue,
 if( nValue == 0 )
 {
 // check if string is equivalent to zero
-sal_Int16 nIndex = bNegative ? 1 : 0;
+sal_Int32 nIndex = bNegative ? 1 : 0;
 while (nIndex < aStr.getLength() && aStr[nIndex] == '0')
 ++nIndex;
 if( nIndex < aStr.getLength() )
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 0a3daac..b1eb9b4 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -582,7 +582,7 @@ void ImpVclMEdit::SetSelection( const Selection& rSelection 
)
 TextSelection aTextSel;
 sal_uInt32 nPara = 0;
 sal_Int32 nChar = 0;
-sal_uInt16 x = 0;
+long x = 0;
 while ( x <= nEnd )
 {
 if ( x == aNewSelection.Min() )
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index bb6d856..2674df3 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -510,7 +510,7 @@ tools::Polygon EnhWMFReader::ReadPolygon(sal_uInt32 
nStartIndex, sal_uInt32 nPoi
 return tools::Polygon();
 
 tools::Polygon aPolygon(nPoints);
-for (sal_uInt16 i = nStartIndex ; i < nPoints && pWMF->good(); i++ )
+for (sal_uInt32 i = nStartIndex ; i < nPoints && pWMF->good(); i++ )
 {
 T nX, nY;
 *pWMF >> nX >> nY;
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 028495d..2122eba 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -709,7 +709,7 @@ void WinMtfOutput::CreateObject( std::unique_ptr 
pObject )
 pLineStyle->aLineInfo.SetWidth(aSize.Width());
 }
 }
-sal_uInt32 nIndex;
+std::vector::size_type nIndex;
 for ( nIndex = 0; nIndex < vGDIObj.size(); nIndex++ )
 {
 if ( !vGDIObj[ nIndex ] )
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 44e8c53..a03781f 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -568,7 +568,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
 
 if ( ( ( nDxAryEntries % nOriginalTextLen ) == 0 ) && ( 
nNewTextLen <= nOriginalTextLen ) )
 {
-sal_uInt16 i; // needed just outside the for
+sal_Int32 i; // needed just outside the for
 pDXAry.reset(new long[ nNewTextLen ]);
 if ( nOptions & ETO_PDY )
 {
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index edc08d2..f18622c 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2050,7 +2050,7 @@ static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP, 
sal_uInt32 sfntLen)
 {
 GlyphOffsets* res = 
static_cast(smalloc(sizeof(GlyphOffsets)));
 sal_uInt8 *loca = nullptr;
-sal_uInt16 i, numTables = GetUInt16(sfntP, 4);
+sal_uInt16 numTables = GetUInt16(sfntP, 4);
 sal_uInt32 locaLen = 0;
 sal_Int16 indexToLocFormat = 0;
 
@@ -2062,7 +2062,7 @@ static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP, 
sal_uInt32 sfntLen)
 numTables = nMaxPossibleTables;
 }
 
-for (i = 0; i < numTables; i++) {
+for (sal_uInt16 i = 0; i < numTables; i++) {
 sal_uInt32 nLargestFixedOffsetPos = 12 + 16 * i + 12;
 sal_uInt32 nMinSize = nLargestFixedOffsetPos + sizeof(sal_uInt32);
 if (nMinSize > sfntLen)
@@ -2088,7 +2088,7 @@ static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP, 
sal_uInt32 sfntLen)
 assert(res->nGlyphs != 0);
 res->offs = static_cast(scalloc(res->nGlyphs, 

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

2016-11-15 Thread Caolán McNamara
 vcl/source/window/syswin.cxx  |4 
 vcl/unx/gtk3/gtk3gtkframe.cxx |4 +++-
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 7e2ef433d29fca84ed27a9203b5761dc8dbd8bf8
Author: Caolán McNamara 
Date:   Tue Nov 15 15:05:44 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 using a mixture of gtk_window_set_default_size before its visible, and
gtk_window_set_default_size + gtk_window_resize after its shown now works 
for
me under wayland so the original problem can be solved that way

Change-Id: Iaf8fd3019a7e902ad07b6825f919c6f25288e9b7

diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index f7732910..e7e6683 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1162,10 +1162,6 @@ void SystemWindow::DoInitialLayout()
 setOptimalLayoutSize();
 mbIsCalculatingInitialLayoutSize = false;
 }
-else if (IsDialog() && !(GetStyle() & WB_SIZEABLE))
-{
-SetMinOutputSizePixel(GetSizePixel());
-}
 }
 
 void SystemWindow::doDeferredInit(WinBits /*nBits*/)
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 3a1fb9a..e17a8b8 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -901,7 +901,9 @@ void GtkSalFrame::window_resize(long nWidth, long nHeight)
 {
 m_nWidthRequest = nWidth;
 m_nHeightRequest = nHeight;
-gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
+gtk_window_set_default_size(GTK_WINDOW(m_pWindow), nWidth, nHeight);
+if (gtk_widget_get_visible(m_pWindow))
+gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
 }
 
 void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-05 Thread Khaled Hosny
 vcl/source/font/PhysicalFontCollection.cxx |1 -
 vcl/source/outdev/font.cxx |5 -
 vcl/unx/generic/gdi/salgdi.cxx |2 --
 3 files changed, 8 deletions(-)

New commits:
commit a04cda96c6b70314546a8126783e573e16c78e1d
Author: Khaled Hosny 
Date:   Sat Nov 5 14:29:19 2016 +0200

Drop unused Graphite includes

Change-Id: Ib5c40931805ef8a484ccb52c5d2b81180f68f0cc

diff --git a/vcl/source/font/PhysicalFontCollection.cxx 
b/vcl/source/font/PhysicalFontCollection.cxx
index 716811b..295de04 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
 #include 
 #include 
 #include 
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 1492fb7..45e8a7a 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -36,11 +36,6 @@
 
 #include "svids.hrc"
 
-#include 
-#if ENABLE_GRAPHITE
-#include "graphite_features.hxx"
-#endif
-
 FontMetric OutputDevice::GetDevFont( int nDevFontIndex ) const
 {
 FontMetric aFontMetric;
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 43022a7..cfb96ea 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
-
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-10-19 Thread Caolán McNamara
 vcl/source/app/IconThemeSelector.cxx  |4 
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |   15 +--
 2 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit 75544eb042ab3fc79dd6104749a32af7e180c116
Author: Caolán McNamara 
Date:   Wed Oct 19 12:57:09 2016 +0100

Resolves: tdf#102778 by default use breeze_dark when dark themes are 
requested

Under gtk3 if gtk-application-prefer-dark-theme is enabled or the requested
icon-theme name ends in [-|_]dark

Change-Id: Ia70ea3adc51ac0ec2b26d08fc960c1c7285c338b

diff --git a/vcl/source/app/IconThemeSelector.cxx 
b/vcl/source/app/IconThemeSelector.cxx
index ce91d5b..91a082c 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -82,6 +82,10 @@ IconThemeSelector::SelectIconThemeForDesktopEnvironment(
 if (icon_theme_is_in_installed_themes(mPreferredIconTheme, 
installedThemes)) {
 return mPreferredIconTheme;
 }
+//if a dark variant is preferred, and we didn't have an exact match, 
then try our one and only dark theme
+if (mPreferredIconTheme.endsWith("_dark") && 
icon_theme_is_in_installed_themes("breeze_dark", installedThemes)) {
+return "breeze_dark";
+}
 }
 
 OUString themeForDesktop = 
GetIconThemeForDesktopEnvironment(desktopEnvironment);
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 3d5ee0f..8d6c2d0 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2719,8 +2719,19 @@ void GtkSalGraphics::updateSettings( AllSettings& 
rSettings )
 
 // preferred icon style
 gchar* pIconThemeName = nullptr;
-g_object_get( pSettings, "gtk-icon-theme-name", , nullptr );
-aStyleSet.SetPreferredIconTheme( OUString::createFromAscii( pIconThemeName 
) );
+gboolean bDarkIconTheme = false;
+g_object_get(pSettings, "gtk-icon-theme-name", ,
+"gtk-application-prefer-dark-theme", 
,
+nullptr );
+OUString sIconThemeName(OUString::createFromAscii(pIconThemeName));
+if (sIconThemeName.endsWithIgnoreAsciiCase("-dark", ) ||
+sIconThemeName.endsWithIgnoreAsciiCase("_dark", ))
+{
+bDarkIconTheme = true;
+}
+if (bDarkIconTheme)
+sIconThemeName += "_dark";
+aStyleSet.SetPreferredIconTheme(sIconThemeName);
 g_free( pIconThemeName );
 
 aStyleSet.SetToolbarIconSize( ToolbarIconSize::Large );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-27 Thread Stephan Bergmann
 vcl/source/gdi/bitmapex.cxx   |3 ++-
 vcl/source/gdi/configsettings.cxx |4 ++--
 vcl/unx/generic/dtrans/config.cxx |4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit de243e8e134c8780e54ebe8402a8a930962852fc
Author: Stephan Bergmann 
Date:   Mon Jun 27 14:58:15 2016 +0200

Clean up uses of Any::getValue() in vcl

Change-Id: Id835d8d11abcd49320c2ea01ec0ad60402f9e759

diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 7030f8e..2066c1b 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -792,7 +793,7 @@ bool BitmapEx::Create( const css::uno::Reference< 
css::rendering::XBitmapCanvas
 {
 // 0 means get BitmapEx
 uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
-std::unique_ptr xBitmapEx(reinterpret_cast( 
*static_cast(aAny.getValue(;
+std::unique_ptr 
xBitmapEx(reinterpret_cast(*o3tl::doAccess(aAny)));
 if( xBitmapEx )
 {
 *this = *xBitmapEx;
diff --git a/vcl/source/gdi/configsettings.cxx 
b/vcl/source/gdi/configsettings.cxx
index f8d72e9..27cc888 100644
--- a/vcl/source/gdi/configsettings.cxx
+++ b/vcl/source/gdi/configsettings.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace utl;
 using namespace vcl;
@@ -111,9 +112,8 @@ void SettingsConfigItem::getValues()
 const Any* pValue = aValues.getConstArray();
 for( int i = 0; i < aValues.getLength(); i++, pValue++ )
 {
-if( pValue->getValueTypeClass() == TypeClass_STRING )
+if( auto pLine = o3tl::tryAccess(*pValue) )
 {
-const OUString* pLine = static_cast(pValue->getValue());
 if( !pLine->isEmpty() )
 m_aSettings[ aKeyName ][ pFrom[i] ] = *pLine;
 #if OSL_DEBUG_LEVEL > 2
diff --git a/vcl/unx/generic/dtrans/config.cxx 
b/vcl/unx/generic/dtrans/config.cxx
index 863522b..cf7bb68 100644
--- a/vcl/unx/generic/dtrans/config.cxx
+++ b/vcl/unx/generic/dtrans/config.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 
 #include "X11_selection.hxx"
@@ -78,9 +79,8 @@ DtransX11ConfigItem::DtransX11ConfigItem() :
 Any* pValue = aValues.getArray();
 for( int i = 0; i < aValues.getLength(); i++, pValue++ )
 {
-if( pValue->getValueTypeClass() == TypeClass_STRING )
+if( auto pLine = o3tl::tryAccess(*pValue) )
 {
-const OUString* pLine = static_cast(pValue->getValue());
 if( !pLine->isEmpty() )
 {
 m_nSelectionTimeout = pLine->toInt32();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-28 Thread Miklos Vajna
 vcl/source/opengl/OpenGLContext.cxx |8 
 vcl/unx/gtk3/gtk3gtkinst.cxx|4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 2465cb26763b2ed8de65f35bce791fb55fe0e746
Author: Miklos Vajna 
Date:   Thu Apr 28 14:04:44 2016 +0200

vcl: fix loplugin:stylepolice

Change-Id: I40455e04a5f69dc0956ccb01c48d8a40245a4506

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 3da890a..2b1e6be 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -790,8 +790,8 @@ bool OpenGLContext::ImplInit()
 m_aGLWin.GLExtensions = glGetString( GL_EXTENSIONS );
 SAL_INFO("vcl.opengl", "available GL  extensions: " << 
m_aGLWin.GLExtensions);
 
-XWindowAttributes xWinAttr;
-if( !XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win,  ) )
+XWindowAttributes aWinAttr;
+if( !XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win,  ) )
 {
 SAL_WARN("vcl.opengl", "Failed to get window attributes on " << 
m_aGLWin.win);
 m_aGLWin.Width = 0;
@@ -799,8 +799,8 @@ bool OpenGLContext::ImplInit()
 }
 else
 {
-m_aGLWin.Width = xWinAttr.width;
-m_aGLWin.Height = xWinAttr.height;
+m_aGLWin.Width = aWinAttr.width;
+m_aGLWin.Height = aWinAttr.height;
 }
 
 if( m_aGLWin.HasGLXExtension("GLX_SGI_swap_control" ) )
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 9c33c40..768f4b1 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -590,7 +590,7 @@ void VclGtkClipboard::setContents(
 m_aContents = xTrans;
 m_aOwner = xClipboardOwner;
 
-std::list< Reference< datatransfer::clipboard::XClipboardListener > > 
xListeners( m_aListeners );
+std::list< Reference< datatransfer::clipboard::XClipboardListener > > 
aListeners( m_aListeners );
 datatransfer::clipboard::ClipboardEvent aEv;
 
 if (m_aContents.is())
@@ -624,7 +624,7 @@ void VclGtkClipboard::setContents(
 if( xOldOwner.is() && xOldOwner != xClipboardOwner )
 xOldOwner->lostOwnership( this, xOldContents );
 for( std::list< Reference< datatransfer::clipboard::XClipboardListener > 
>::iterator it =
- xListeners.begin(); it != xListeners.end() ; ++it )
+ aListeners.begin(); it != aListeners.end() ; ++it )
 {
 (*it)->changedContents( aEv );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-30 Thread slideon
 vcl/source/fontsubset/gsub.cxx |9 -
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |9 -
 2 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 7b3dbf6cd1bad9a1cc94221952ac6cc54280b7d2
Author: slideon 
Date:   Tue Mar 29 18:32:18 2016 -0400

tdf#96099 Remove trivial typedefs from vcl module

This typedef was not needed.

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

diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index d9971fe..6ef40f2 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -77,8 +77,7 @@ bool ReadGSUB( struct TrueTypeFont* pTTFile,
 
 aReqFeatureTagList.push_back( MKTAG("vert") );
 
-typedef std::vector UshortList;
-UshortList aFeatureIndexList;
+std::vector aFeatureIndexList;
 
 // parse Script Table
 const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
@@ -150,8 +149,8 @@ bool ReadGSUB( struct TrueTypeFont* pTTFile,
 if( aFeatureIndexList.empty() )
 return true;
 
-UshortList aLookupIndexList;
-UshortList aLookupOffsetList;
+std::vector aLookupIndexList;
+std::vector aLookupOffsetList;
 
 // parse Feature Table
 const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
@@ -205,7 +204,7 @@ bool ReadGSUB( struct TrueTypeFont* pTTFile,
 aLookupOffsetList.push_back( nOffset );
 }
 
-UshortList::const_iterator it = aLookupOffsetList.begin();
+std::vector::const_iterator it = aLookupOffsetList.begin();
 for(; it != aLookupOffsetList.end(); ++it )
 {
 const sal_uInt16 nOfsLookupTable = *it;
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx 
b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index e25a2e0..0a10247 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -1329,8 +1329,7 @@ void ServerFont::ApplyGSUB( const FontSelectPattern& rFSD 
)
 const sal_uInt16 nOfsFeatureTable   = GetUShort( pGsubHeader+6 );
 const sal_uInt16 nOfsLookupList = GetUShort( pGsubHeader+8 );
 
-typedef std::vector UshortList;
-UshortList aFeatureIndexList;
+std::vector aFeatureIndexList;
 
 // parse Script Table
 const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
@@ -1386,8 +1385,8 @@ void ServerFont::ApplyGSUB( const FontSelectPattern& rFSD 
)
 if( aFeatureIndexList.empty() )
 return;
 
-UshortList aLookupIndexList;
-UshortList aLookupOffsetList;
+std::vector aLookupIndexList;
+std::vector aLookupOffsetList;
 
 // parse Feature Table
 const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
@@ -1436,7 +1435,7 @@ void ServerFont::ApplyGSUB( const FontSelectPattern& rFSD 
)
 aLookupOffsetList.push_back( nOffset );
 }
 
-UshortList::const_iterator lookup_it = aLookupOffsetList.begin();
+std::vector::const_iterator lookup_it = 
aLookupOffsetList.begin();
 for(; lookup_it != aLookupOffsetList.end(); ++lookup_it )
 {
 const sal_uInt16 nOfsLookupTable = *lookup_it;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-07 Thread Caolán McNamara
 vcl/source/control/edit.cxx  |2 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 55b81956ab5f0f80a2edf69421164ac74597bfd1
Author: Caolán McNamara 
Date:   Mon Mar 7 10:36:34 2016 +

Resolves: tdf#98425 gtk3: grab the SolarMutex when setting the clipboard

Change-Id: Ic439affbd69532534f5caf82a743786d5975939e

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index d59d2b5..9dab058 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2633,7 +2633,7 @@ void Edit::Copy()
 
 void Edit::Paste()
 {
-css::uno::Reference 
aClipboard(GetClipboard());
+css::uno::Reference 
aClipboard(GetClipboard());
 ImplPaste( aClipboard );
 }
 
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 32e1a57..296c145 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -524,6 +524,8 @@ VclGtkClipboard::VclGtkClipboard(GdkAtom nSelection)
 void VclGtkClipboard::flushClipboard()
   throw (RuntimeException, std::exception)
 {
+SolarMutexGuard aGuard;
+
 if (GDK_SELECTION_CLIPBOARD != m_nSelection)
 return;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-30 Thread Andrea Gelmini
 vcl/source/window/accel.cxx   |2 +-
 vcl/source/window/accmgr.cxx  |2 +-
 vcl/source/window/dlgctrl.cxx |4 ++--
 vcl/source/window/dockmgr.cxx |2 +-
 vcl/source/window/floatwin.cxx|2 +-
 vcl/source/window/paint.cxx   |2 +-
 vcl/source/window/splitwin.cxx|2 +-
 vcl/source/window/syswin.cxx  |2 +-
 vcl/source/window/toolbox.cxx |2 +-
 vcl/source/window/window.cxx  |2 +-
 vcl/source/window/winproc.cxx |4 ++--
 vcl/unx/generic/app/i18n_cb.cxx   |2 +-
 vcl/unx/generic/printer/ppdparser.cxx |2 +-
 vcl/unx/gtk/a11y/atkaction.cxx|2 +-
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |2 +-
 15 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 835d7774e78df95d0c59243b6c1b8ed1b51b2311
Author: Andrea Gelmini 
Date:   Tue Sep 29 18:13:24 2015 +0200

Fix typos

Change-Id: I2cf36eb80068adcf57238a286f09bdc96b4e01f8
Reviewed-on: https://gerrit.libreoffice.org/18994
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 75ea7bc..a8ce0a4 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -56,7 +56,7 @@ sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, 
sal_uInt16 nId,
 return ACCELENTRY_NOTFOUND;
 }
 
-// Binairy search
+// Binary search
 nLow  = 0;
 nHigh = nCount-1;
 do
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx
index e855193..b94e8c0 100644
--- a/vcl/source/window/accmgr.cxx
+++ b/vcl/source/window/accmgr.cxx
@@ -167,7 +167,7 @@ bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& 
rKeyCode, sal_uInt16 nRep
 }
 else
 {
-// stop sequence as the accelerator was disbled
+// stop sequence as the accelerator was disabled
 // transfer the key (to the system)
 FlushAccel();
 return false;
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index cf8ac99..105ba5a 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -39,7 +39,7 @@ using namespace ::com::sun::star;
 
 static bool ImplHasIndirectTabParent( vcl::Window* pWindow )
 {
-// The window has inderect tab parent if it is included in tab hierarchy
+// The window has indirect tab parent if it is included in tab hierarchy
 // of the indirect parent window
 
 vcl::Window* pNonLayoutParent = getNonLayoutParent(pWindow);
@@ -313,7 +313,7 @@ vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pParent, 
vcl::Window* pWindow,
   && pSWindow->ImplGetWindow()->IsDialogControlStart() )
 nFormStart = i;
 
-// SecondWindow for composit controls like ComboBoxes and arrays
+// SecondWindow for composite controls like ComboBoxes and arrays
 if ( pSWindow->ImplIsWindowOrChild( pWindow ) )
 {
 pSecondWindow = pSWindow;
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 0de1c43..4eba036 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -1125,7 +1125,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox 
*pParentToolBox, FloatWin
 GetWindow()->mpWindowImpl->mnRightBorder   = 0;
 GetWindow()->mpWindowImpl->mnBottomBorder  = 0;
 
-// position toolbox below dragrect
+// position toolbox below DragRect
 GetWindow()->SetPosPixel( pWin->GetToolboxPosition() );
 
 // reparent borderwindow and window
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 80c8f0c..c470f75 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -72,7 +72,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits 
nStyle )
 
 DBG_ASSERT(pParent, "FloatWindow::FloatingWindow(): - pParent == NULL and 
no AppWindow exists");
 
-// no Border, then we dont need a border window
+// no Border, then we don't need a border window
 if (!nStyle)
 {
 mpWindowImpl->mbOverlapWin = true;
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index af14227..ade79ba 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -504,7 +504,7 @@ void Window::PushPaintHelper(PaintHelper *pHelper, 
vcl::RenderContext& rRenderCo
 Erase(rRenderContext);
 }
 
-// #98943# trigger drawing of toolbox selection after all childern are 
painted
+// #98943# trigger drawing of toolbox selection after all children are 
painted
 if (mpWindowImpl->mbDrawSelectionBackground)
 

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

2015-08-18 Thread Mark Hung
 vcl/source/gdi/sallayout.cxx|2 +-
 vcl/unx/generic/gdi/cairotextrender.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8ead1423f10dee87967c5fabb2f26046bbb8
Author: Mark Hung mark...@gmail.com
Date:   Tue Aug 18 20:17:05 2015 +0800

tdf#832525 - Wrong punctuation direction after Chinese characters in

vertical layout.

Change-Id: I6391e665db205545f0d660e3de826755c954f286
Reviewed-on: https://gerrit.libreoffice.org/17836
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 2e1461f..3fcf3c6 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -200,7 +200,7 @@ int GetVerticalFlags( sal_UCS4 nChar )
  are GF_NONE also, but already handled in the outer if condition
 */
 if((nChar = 0x3008  nChar = 0x301C  nChar != 0x3012)
-|| (nChar == 0xFF3B || nChar == 0xFF3D)
+|| (nChar == 0xFF3B || nChar == 0xFF3D || nChar==0xFF08 || 
nChar==0xFF09)
 || (nChar = 0xFF5B  nChar = 0xFF9F) // halfwidth forms
 || (nChar == 0xFFE3) )
 return GF_NONE; // not rotated
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx 
b/vcl/unx/generic/gdi/cairotextrender.cxx
index ebef272..0f9fafc 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -248,7 +248,7 @@ void CairoTextRender::DrawServerFontLayout( const 
ServerFontLayout rLayout )
 {
 int nGlyphRotation = *aI;
 
-std::vectorint::const_iterator aNext = std::find_if(aI+1, aEnd, 
hasRotation);
+std::vectorint::const_iterator aNext = 
nGlyphRotation?(aI+1):std::find_if(aI+1, aEnd, hasRotation);
 
 size_t nStartIndex = std::distance(aStart, aI);
 size_t nLen = std::distance(aI, aNext);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-09 Thread Simon Long
 vcl/source/window/menu.cxx   |9 -
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |8 +++-
 2 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit ae4ec7a75b0048af2fba12953a84fe5b26d89b9a
Author: Simon Long si...@raspberrypi.org
Date:   Wed Jul 8 13:51:10 2015 +0100

tdf#92243 Read menu highlight text colour correctly from GTK theme

Change-Id: Iade050c8504a1cc65b5ac345141da32898e7ebff
Reviewed-on: https://gerrit.libreoffice.org/16887
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index afe44c6..cb83637 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1853,12 +1853,11 @@ void Menu::ImplPaint(vcl::RenderContext rRenderContext,
 
rRenderContext.SetTextColor(rSettings.GetMenuBarRolloverTextColor());
 else if (bHighlighted)
 
rRenderContext.SetTextColor(rSettings.GetMenuBarHighlightTextColor());
+else
+
rRenderContext.SetTextColor(rSettings.GetMenuBarTextColor());
 }
-else
-{
-if (bHighlighted)
-
rRenderContext.SetTextColor(rSettings.GetMenuHighlightTextColor());
-}
+else if (bHighlighted)
+
rRenderContext.SetTextColor(rSettings.GetMenuHighlightTextColor());
 }
 
 Point aPos(aTopLeft);
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 713cbe5..89c0f62 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -4017,8 +4017,8 @@ void GtkSalGraphics::updateSettings( AllSettings 
rSettings )
 
 aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( 
getColor( pMenubarStyle-fg[GTK_STATE_NORMAL] ) );
 aStyleSet.SetMenuBarTextColor( aTextColor );
-aStyleSet.SetMenuBarRolloverTextColor( aTextColor );
-
aStyleSet.SetMenuBarHighlightTextColor(aStyleSet.GetMenuHighlightTextColor());
+
aStyleSet.SetMenuBarRolloverTextColor(getColor(pMenubarStyle-fg[GTK_STATE_PRELIGHT]));
+
aStyleSet.SetMenuBarHighlightTextColor(getColor(pMenubarStyle-fg[GTK_STATE_SELECTED]));
 
 #if OSL_DEBUG_LEVEL  1
 std::fprintf( stderr, ==\n );
@@ -4049,9 +4049,7 @@ void GtkSalGraphics::updateSettings( AllSettings 
rSettings )
 }
 
 aHighlightColor = getColor( pMenuItemStyle-bg[ GTK_STATE_SELECTED ] );
-aHighlightTextColor = getColor( pMenuTextStyle-fg[ GTK_STATE_PRELIGHT ] );
-if( aHighlightColor == aHighlightTextColor )
-aHighlightTextColor = (aHighlightColor.GetLuminance()  128) ? Color( 
COL_WHITE ) : Color( COL_BLACK );
+aHighlightTextColor = getColor( pMenuItemStyle-fg[ GTK_STATE_SELECTED ] );
 aStyleSet.SetMenuHighlightColor( aHighlightColor );
 aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-04-28 Thread Caolán McNamara
 vcl/source/control/tabctrl.cxx|   16 
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |5 +
 2 files changed, 21 insertions(+)

New commits:
commit a0c8b9c502be6df8ba853f3e8c0d4e45bb2785b2
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 28 20:53:04 2015 +0100

gtk3: implement notebook header support

Change-Id: I0dd0feb2a254b6cdb4730e2c9fd2abc80e992025

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 5e24802..1931ac9 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1115,6 +1115,22 @@ void TabControl::ImplPaint( const Rectangle rRect, bool 
bLayout )
 DrawNativeControl(CTRL_TAB_PANE, PART_ENTIRE_CONTROL, aRect, 
nState,
 aControlValue, OUString());
 }
+
+if (IsNativeControlSupported(CTRL_TAB_HEADER, PART_ENTIRE_CONTROL))
+{
+Rectangle aHeaderRect(0, 0, GetSizePixel().Width(), aRect.Top());
+
+aClipRgn = GetActiveClipRegion();
+aClipRgn.Intersect( aHeaderRect );
+if( !rRect.IsEmpty() )
+aClipRgn.Intersect( rRect );
+
+if( !aClipRgn.IsEmpty() )
+{
+DrawNativeControl(CTRL_TAB_HEADER, PART_ENTIRE_CONTROL, 
aHeaderRect, nState,
+aControlValue, OUString());
+}
+}
 }
 else
 {
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index acb542f..aad0ca5 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -932,6 +932,10 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, 
ControlPart nPart, co
 case CTRL_TAB_PANE:
 context = mpNoteBookStyle;
 break;
+case CTRL_TAB_HEADER:
+context = mpNoteBookStyle;
+styleClass = GTK_STYLE_CLASS_HEADER;
+break;
 case CTRL_TAB_ITEM:
 context = mpNoteBookStyle;
 if (nState  ControlState::SELECTED)
@@ -1540,6 +1544,7 @@ bool GtkSalGraphics::IsNativeControlSupported( 
ControlType nType, ControlPart nP
 //return true;
 
 case CTRL_TAB_ITEM:
+case CTRL_TAB_HEADER:
 case CTRL_TAB_PANE:
 case CTRL_TAB_BODY:
 if(nPart==PART_ENTIRE_CONTROL || nPart==PART_TABS_DRAW_RTL)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-04-26 Thread Caolán McNamara
 vcl/source/control/ilstbox.cxx|2 +-
 vcl/source/control/lstbox.cxx |8 
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit b7f15ab8271ff789aaab0d58a5da42738267cd6a
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Apr 26 15:09:04 2015 +0100

gtk3: sane height for list boxes too

Change-Id: I40515c6cfe2a3ea8fc6e2577561c2e54ead09fac

diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 0500a46..64d009a 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2661,7 +2661,7 @@ void ImplWin::ImplDraw( bool bLayout )
 // vcl/source/window/brdwin.cxx
 vcl::Window *pWin = GetParent();
 
-ImplControlValue aControlValue;
+EditBoxValue aControlValue(GetTextHeight());
 if ( !pWin-IsEnabled() )
 nState = ~ControlState::ENABLED;
 if ( pWin-HasFocus() )
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 131d0fe..a35c502 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -116,7 +116,7 @@ void ListBox::ImplInit( vcl::Window* pParent, WinBits 
nStyle )
 if( IsNativeWidgetEnabled() 
 IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
 {
-ImplControlValue aControlValue;
+EditBoxValue aControlValue(GetTextHeight());
 Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) );
 Rectangle aBoundingRgn( aCtrlRegion );
 Rectangle aContentRgn( aCtrlRegion );
@@ -626,7 +626,7 @@ void ListBox::Resize()
 
 // Note: in case of no border, pBorder will actually be this
 vcl::Window *pBorder = GetWindow( WINDOW_BORDER );
-ImplControlValue aControlValue;
+EditBoxValue aControlValue(GetTextHeight());
 Point aPoint;
 Rectangle aContent, aBound;
 
@@ -1212,7 +1212,7 @@ Size ListBox::CalcMinimumSize() const
 {
 // Try native borders; scrollbar size may not be a good indicator
 // See how large the edit area inside is to estimate what is needed 
for the dropdown
-ImplControlValue aControlValue;
+EditBoxValue aControlValue(GetTextHeight());
 Point aPoint;
 Rectangle aContent, aBound;
 Size aTestSize( 100, 20 );
@@ -1231,7 +1231,7 @@ Size ListBox::CalcMinimumSize() const
 
 if (IsDropDownBox()) // Check minimum height of dropdown box
 {
-ImplControlValue aControlValue;
+EditBoxValue aControlValue(GetTextHeight());
 Rectangle aRect( Point( 0, 0 ), aSz );
 Rectangle aContent, aBound;
 if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aRect, 
ControlState::NONE,
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 97c7929..7617890 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1069,7 +1069,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType 
nType, ControlPart nPar
 {
 aEditRect = NWGetComboBoxButtonRect( nType, nPart, rControlRegion );
 }
-else if ((nType == CTRL_EDITBOX || nType == CTRL_COMBOBOX)  nPart == 
PART_ENTIRE_CONTROL)
+else if ((nType == CTRL_EDITBOX || nType == CTRL_LISTBOX || nType == 
CTRL_COMBOBOX)  nPart == PART_ENTIRE_CONTROL)
 {
 gtk_style_context_save(mpEntryStyle);
 gtk_style_context_add_class(mpEntryStyle, GTK_STYLE_CLASS_ENTRY);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-04-25 Thread Caolán McNamara
 vcl/source/control/combobox.cxx   |6 +++---
 vcl/source/window/brdwin.cxx  |9 +++--
 vcl/source/window/toolbox.cxx |2 +-
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |2 +-
 4 files changed, 8 insertions(+), 11 deletions(-)

New commits:
commit ed3c69588a7f65cb534075a68607b094c40664f0
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 25 15:39:05 2015 +0100

gtk3: get the right height for Combo boxes

Change-Id: Ib856952572104d224cd731237bf7c33d028e6544

diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 3d5a41f..be0e048 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -104,7 +104,7 @@ void ComboBox::ImplCalcEditHeight()
 
 Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) );
 Rectangle aBoundRegion, aContentRegion;
-ImplControlValue aControlValue;
+EditBoxValue aControlValue(GetTextHeight());
 ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX;
 if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL,
 aCtrlRegion,
@@ -981,7 +981,7 @@ long ComboBox::getMaxWidthScrollBarAndDownButton() const
 long nButtonDownWidth = 0;
 
 vcl::Window *pBorder = GetWindow( WINDOW_BORDER );
-ImplControlValue aControlValue;
+EditBoxValue aControlValue(GetTextHeight());
 Point aPoint;
 Rectangle aContent, aBound;
 
@@ -1414,7 +1414,7 @@ ComboBox::ComboBoxBounds 
ComboBox::calcComboBoxDropDownComponentBounds(const Siz
 longnBottom = rOutSz.Height();
 
 vcl::Window *pBorder = GetWindow( WINDOW_BORDER );
-ImplControlValue aControlValue;
+EditBoxValue aControlValue(GetTextHeight());
 Point aPoint;
 Rectangle aContent, aBound;
 
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index e4322e1..c472777 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1043,6 +1043,8 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, 
long nWidth, long nHei
 std::unique_ptrImplControlValue xControlValue(new 
ImplControlValue());
 if (pCtrl)
 {
+xControlValue.reset(new EditBoxValue(pCtrl-GetTextHeight()));
+
 switch( pCtrl-GetType() )
 {
 case WINDOW_LISTBOX:
@@ -1077,10 +1079,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* 
pDev, long nWidth, long nHei
 if (pCtrl-GetStyle()  WB_SPIN)
 aCtrlType = CTRL_SPINBOX;
 else
-{
 aCtrlType = CTRL_EDITBOX;
-xControlValue.reset(new 
EditBoxValue(pWin-GetTextHeight()));
-}
 break;
 default:
 break;
@@ -1201,6 +1200,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 
nDrawFlags, OutputDevice*
 std::unique_ptrImplControlValue xControlValue(new ImplControlValue());
 if( pWin  (pCtrl = mpBorderWindow-GetWindow( WINDOW_CLIENT )) != NULL )
 {
+xControlValue.reset(new EditBoxValue(pCtrl-GetTextHeight()));
 switch( pCtrl-GetType() )
 {
 case WINDOW_MULTILINEEDIT:
@@ -1219,10 +1219,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 
nDrawFlags, OutputDevice*
 if( pCtrl-GetStyle()  WB_SPIN )
 aCtrlType = CTRL_SPINBOX;
 else
-{
 aCtrlType = CTRL_EDITBOX;
-xControlValue.reset(new 
EditBoxValue(pCtrl-GetTextHeight()));
-}
 break;
 
 case WINDOW_LISTBOX:
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 34ad659..5b62793 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1655,7 +1655,7 @@ bool ToolBox::ImplCalcItem()
 {
 Rectangle aRect( Point( 0, 0 ), Size( nMinWidth, nMinHeight ) );
 Rectangle aReg( aRect );
-ImplControlValue aVal;
+EditBoxValue aVal(GetTextHeight());
 Rectangle aNativeBounds, aNativeContent;
 if( IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
 {
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 9c992ba..77dfa59 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1069,7 +1069,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType 
nType, ControlPart nPar
 {
 aEditRect = NWGetComboBoxButtonRect( nType, nPart, rControlRegion );
 }
-else if (nType == CTRL_EDITBOX)
+else if ((nType == CTRL_EDITBOX || nType == CTRL_COMBOBOX)  nPart == 
PART_ENTIRE_CONTROL)
 {
 gtk_style_context_save(mpEntryStyle);
 

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

2015-01-18 Thread Michael Weghorn
 vcl/source/window/menufloatingwindow.cxx |6 ++
 vcl/source/window/splitwin.cxx   |6 ++
 vcl/source/window/status.cxx |4 +---
 vcl/source/window/taskpanelist.cxx   |5 +++--
 vcl/source/window/toolbox.cxx|6 +++---
 vcl/unx/generic/app/salinst.cxx  |3 +--
 vcl/unx/generic/printer/ppdparser.cxx|8 +++-
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx |3 +--
 vcl/win/source/app/saldata.cxx   |3 +--
 vcl/win/source/gdi/gdiimpl.cxx   |3 +--
 10 files changed, 18 insertions(+), 29 deletions(-)

New commits:
commit f5f7a69628ad316298febe7b51234428a7896ff9
Author: Michael Weghorn m.wegh...@posteo.de
Date:   Sat Jan 17 01:36:45 2015 +0100

fdo#39440 vcl: reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: Ia3910e7f1b33d16866b7e606fd648f152f9fe67a
Reviewed-on: https://gerrit.libreoffice.org/13971
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/vcl/source/window/menufloatingwindow.cxx 
b/vcl/source/window/menufloatingwindow.cxx
index 3647960..e4b1124 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -70,11 +70,10 @@ void MenuFloatingWindow::doShutdown()
 if (!bKeyInput  pMenu  pMenu-pStartedFrom  
!pMenu-pStartedFrom-IsMenuBar())
 {
 // #102461# remove highlight in parent
-MenuItemData* pData;
 size_t i, nCount = pMenu-pStartedFrom-pItemList-size();
 for(i = 0; i  nCount; i++)
 {
-pData = pMenu-pStartedFrom-pItemList-GetDataFromPos( i );
+MenuItemData* pData = 
pMenu-pStartedFrom-pItemList-GetDataFromPos( i );
 if( pData  ( pData-pSubMenu == pMenu ) )
 break;
 }
@@ -672,11 +671,10 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 
n, bool bStartPopupTime
 if (pMenu-pStartedFrom  !pMenu-pStartedFrom-IsMenuBar())
 {
 // #102461# make sure parent entry is highlighted as well
-MenuItemData* pData;
 size_t i, nCount = pMenu-pStartedFrom-pItemList-size();
 for(i = 0; i  nCount; i++)
 {
-pData = pMenu-pStartedFrom-pItemList-GetDataFromPos( i );
+MenuItemData* pData = 
pMenu-pStartedFrom-pItemList-GetDataFromPos( i );
 if( pData  ( pData-pSubMenu == pMenu ) )
 break;
 }
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index ab313f9..3dd3e8c 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -416,7 +416,6 @@ static void ImplCalcSet( ImplSplitSet* pSet,
 sal_uInt16  nAbsItems;
 longnCalcSize;
 longnSizeDelta;
-longnCurSize;
 longnSizeWinSize;
 longnNewSizeWinSize;
 longnTemp;
@@ -443,7 +442,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
 else
 nCalcSize = nSetWidth;
 nCalcSize -= (nVisItems-1)*pSet-mnSplitSize;
-nCurSize   = 0;
+long nCurSize   = 0;
 if ( pSet-mbCalcPix || (pSet-mnLastSize != nCalcSize) )
 {
 long nPercentFactor = 10;
@@ -2003,7 +2002,6 @@ void SplitWindow::ImplStartSplit( const MouseEvent rMEvt 
)
 ImplSplitItem*  pSplitItem;
 longnCurMaxSize;
 sal_uInt16  nTemp;
-boolbDown;
 boolbPropSmaller;
 
 mnMouseModifier = rMEvt.GetModifier();
@@ -2028,7 +2026,7 @@ void SplitWindow::ImplStartSplit( const MouseEvent rMEvt 
)
 
 if ( mpSplitSet-mpItems )
 {
-bDown = true;
+bool bDown = true;
 if ( (mpSplitSet == mpMainSet)  mbBottomRight )
 bDown = false;
 
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 5751c92..bca642e23 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -315,11 +315,9 @@ Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) 
const
 
 sal_uInt16 StatusBar::ImplGetFirstVisiblePos() const
 {
-ImplStatusItem* pItem;
-
 for( size_t nPos = 0; nPos  mpItemList-size(); nPos++ )
 {
-pItem = (*mpItemList)[ nPos ];
+ImplStatusItem* pItem = (*mpItemList)[ nPos ];
 if ( pItem )
 {
 if ( pItem-mbVisible )
diff --git a/vcl/source/window/taskpanelist.cxx 
b/vcl/source/window/taskpanelist.cxx
index cc13f15..23b9648 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -162,12 +162,13 @@ bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
 
 // Since the design of Ctrl-Tab looks to be inconsistent ( non-modal 
dialogs are not reachable
 // and the shortcut conflicts 

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

2014-03-08 Thread Takeshi Abe
 vcl/source/gdi/gfxlink.cxx |9 +
 vcl/source/gdi/impanmvw.cxx|   10 --
 vcl/source/gdi/impgraph.cxx|   27 ---
 vcl/source/gdi/impvect.cxx |   22 +++---
 vcl/source/gdi/outdev4.cxx |   19 +++
 vcl/source/gdi/outdev6.cxx |   19 +--
 vcl/source/gdi/pdfwriter_impl2.cxx |   15 +++
 vcl/unx/generic/gdi/salbmp.cxx |   19 ++-
 vcl/unx/generic/gdi/salgdi2.cxx|   11 +--
 9 files changed, 70 insertions(+), 81 deletions(-)

New commits:
commit 06024a58e01a41fe5ce5af38b7714ea6c66a6832
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Sun Mar 9 00:44:27 2014 +0900

Avoid possible resource leaks with boost::scoped_ptr

Change-Id: Ic6e8482dfb022f32532b5c1a6e045092c3485106

diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 1d726ba..3d6ba2951 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -28,6 +28,7 @@
 #include vcl/gfxlink.hxx
 #include vcl/cvtgrf.hxx
 #include com/sun/star/ucb/CommandAbortedException.hpp
+#include boost/scoped_ptr.hpp
 
 GfxLink::GfxLink() :
 meType  ( GFX_LINK_TYPE_NONE ),
@@ -346,12 +347,12 @@ ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) 
:
 maURL = aTempFile.GetURL();
 if( !maURL.isEmpty() )
 {
-SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL, 
STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
+boost::scoped_ptrSvStream 
pOStm(::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE | 
STREAM_SHARE_DENYWRITE ));
 if( pOStm )
 {
 pOStm-Write( pData, mnDataSize );
 bool bError = ( ERRCODE_NONE != pOStm-GetError() );
-delete pOStm;
+pOStm.reset();
 
 if( bError )
 {
@@ -375,7 +376,7 @@ sal_uInt8* ImpSwap::GetData() const
 
 if( IsSwapped() )
 {
-SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, 
STREAM_READWRITE );
+boost::scoped_ptrSvStream 
pIStm(::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE ));
 if( pIStm )
 {
 pData = new sal_uInt8[ mnDataSize ];
@@ -386,7 +387,7 @@ sal_uInt8* ImpSwap::GetData() const
 {
 bError = true;
 }
-delete pIStm;
+pIStm.reset();
 
 if( bError )
 delete[] pData, pData = NULL;
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index 5a54530..ee34d1fd 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -22,6 +22,7 @@
 #include vcl/virdev.hxx
 #include vcl/window.hxx
 #include tools/helpers.hxx
+#include boost/scoped_ptr.hpp
 
 ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut,
 const Point rPt, const Size rSz,
@@ -155,7 +156,7 @@ void ImplAnimView::ImplGetPosSize( const AnimationBitmap 
rAnm, Point rPosPix,
 void ImplAnimView::ImplDrawToPos( sal_uLong nPos )
 {
 VirtualDevice   aVDev;
-Region* pOldClip = !maClip.IsNull() ? new Region( 
mpOut-GetClipRegion() ) : NULL;
+boost::scoped_ptrRegion pOldClip(!maClip.IsNull() ? new Region( 
mpOut-GetClipRegion() ) : NULL);
 
 aVDev.SetOutputSizePixel( maSzPix, false );
 nPos = std::min( nPos, (sal_uLong) mpParent-Count() - 1UL );
@@ -169,10 +170,7 @@ void ImplAnimView::ImplDrawToPos( sal_uLong nPos )
 mpOut-DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, aVDev );
 
 if( pOldClip )
-{
 mpOut-SetClipRegion( *pOldClip );
-delete pOldClip;
-}
 }
 
 void ImplAnimView::ImplDraw( sal_uLong nPos )
@@ -269,7 +267,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* 
pVDev )
 
 if( !pVDev )
 {
-Region* pOldClip = !maClip.IsNull() ? new Region( 
mpOut-GetClipRegion() ) : NULL;
+boost::scoped_ptrRegion pOldClip(!maClip.IsNull() ? new Region( 
mpOut-GetClipRegion() ) : NULL);
 
 if( pOldClip )
 mpOut-SetClipRegion( maClip );
@@ -279,7 +277,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* 
pVDev )
 if( pOldClip )
 {
 mpOut-SetClipRegion( *pOldClip );
-delete pOldClip;
+pOldClip.reset();
 }
 
 delete pDev;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index a118405..7f346cf 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -37,6 +37,7 @@
 #include impgraph.hxx
 #include com/sun/star/ucb/CommandAbortedException.hpp
 #include vcl/dibtools.hxx
+#include boost/scoped_ptr.hpp
 
 #define GRAPHIC_MAXPARTLEN  256000L
 #define GRAPHIC_MTFTOBMP_MAXEXT 2048
@@ -1097,10 +1098,10 @@ bool ImpGraphic::ImplReadEmbedded( SvStream rIStm, 
bool bSwap )
 
   

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

2013-06-13 Thread Julien Nabet
 vcl/source/gdi/bmpacc3.cxx   |4 ++--
 vcl/source/gdi/outdev.cxx|2 +-
 vcl/source/gdi/outdev2.cxx   |4 ++--
 vcl/source/gdi/outmap.cxx|8 
 vcl/source/gdi/region.cxx|2 +-
 vcl/source/gdi/salgdilayout.cxx  |2 +-
 vcl/source/window/window.cxx |4 ++--
 vcl/unx/generic/gdi/salgdi.cxx   |2 +-
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |2 +-
 vcl/win/source/gdi/salgdi.cxx|2 +-
 10 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 6934312f617ccd86d0467e38129c2e5d861241b5
Author: Julien Nabet serval2...@yahoo.fr
Date:   Thu Jun 13 22:18:20 2013 +0200

cppcheck: fix all the others Prefer prefix ++/-- operators

Change-Id: I7956510a5faf1d659f88268941f8afce44e83560

diff --git a/vcl/source/gdi/bmpacc3.cxx b/vcl/source/gdi/bmpacc3.cxx
index c35f531..8d327ae 100644
--- a/vcl/source/gdi/bmpacc3.cxx
+++ b/vcl/source/gdi/bmpacc3.cxx
@@ -262,7 +262,7 @@ void BitmapWriteAccess::FillPolygon( const Polygon rPoly )
 RectangleVector aRectangles;
 aRegion.GetRegionRectangles(aRectangles);
 
-for(RectangleVector::const_iterator 
aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++)
+for(RectangleVector::const_iterator 
aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); ++aRectIter)
 {
 for(long nY = aRectIter-Top(), nEndY = aRectIter-Bottom(); 
nY = nEndY; nY++)
 {
@@ -323,7 +323,7 @@ void BitmapWriteAccess::FillPolyPolygon( const PolyPolygon 
rPolyPoly )
 RectangleVector aRectangles;
 aRegion.GetRegionRectangles(aRectangles);
 
-for(RectangleVector::const_iterator 
aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++)
+for(RectangleVector::const_iterator 
aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); ++aRectIter)
 {
 for(long nY = aRectIter-Top(), nEndY = aRectIter-Bottom(); 
nY = nEndY; nY++)
 {
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 090f229..4c3f73a 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -533,7 +533,7 @@ voidOutputDevice::ImplReMirror( Region rRegion ) const
 rRegion.GetRegionRectangles(aRectangles);
 Region aMirroredRegion;
 
-for(RectangleVector::iterator aRectIter(aRectangles.begin()); aRectIter != 
aRectangles.end(); aRectIter++)
+for(RectangleVector::iterator aRectIter(aRectangles.begin()); aRectIter != 
aRectangles.end(); ++aRectIter)
 {
 ImplReMirror(*aRectIter);
 aMirroredRegion.Union(*aRectIter);
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 915fb89..cc61006 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1963,7 +1963,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap 
rBmp, const Bitmap rMask
 RectangleVector aRectangles;
 aWorkRgn.GetRegionRectangles(aRectangles);
 
-for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); 
aRectIter != aRectangles.end(); aRectIter++)
+for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); 
aRectIter != aRectangles.end(); ++aRectIter)
 {
 const Point aMapPt(pMapX[aRectIter-Left()], 
pMapY[aRectIter-Top()]);
 const Size aMapSz(
@@ -2069,7 +2069,7 @@ void OutputDevice::ImplPrintMask( const Bitmap rMask, 
const Color rMaskColor,
 RectangleVector aRectangles;
 aWorkRgn.GetRegionRectangles(aRectangles);
 
-for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); 
aRectIter != aRectangles.end(); aRectIter++)
+for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); 
aRectIter != aRectangles.end(); ++aRectIter)
 {
 const Point aMapPt(pMapX[aRectIter-Left()], 
pMapY[aRectIter-Top()]);
 const Size aMapSz(
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index 7ef70f8..6a10498 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -1175,7 +1175,7 @@ Region OutputDevice::LogicToPixel( const Region 
rLogicRegion ) const
 const RectangleVector rRectangles(aRectangles); // needed to make the 
'!=' work
 
 // make reverse run to fill new region bottom-up, this will speed it 
up due to the used data structuring
-for(RectangleVector::const_reverse_iterator 
aRectIter(rRectangles.rbegin()); aRectIter != rRectangles.rend(); aRectIter++)
+for(RectangleVector::const_reverse_iterator 
aRectIter(rRectangles.rbegin()); aRectIter != rRectangles.rend(); ++aRectIter)
 {
 aRegion.Union(LogicToPixel(*aRectIter));
 }
@@ -1386,7 +1386,7 @@ Region OutputDevice::LogicToPixel( const Region 
rLogicRegion, const MapMode rM
 const