Resolves: rhbz#980387 Exporting a odg to jpg or tiff generates error

f41
David Tardon 12 years ago
parent 03df115011
commit 8e2a8e6a68

@ -0,0 +1,63 @@
From 70376f610a7eb876739829e1f362bc94b21cb82f Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 11 Jul 2013 09:25:16 +0200
Subject: [PATCH] rhbz#980387 fix filter selection from file ext.
... for filters that have more than one extension associated with them
(e.g., JPEG).
Change-Id: Ic6b16d3b4aa17580404d02a9fb7b087b9aa52fc2
---
vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index 389e3f3..d237b86 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/ControlActions.hpp>
#include <com/sun/star/uno/Any.hxx>
+#include <comphelper/string.hxx>
#include <osl/mutex.hxx>
#include "unx/gtk/gtkinst.hxx"
@@ -790,6 +791,25 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getFiles() throw( uno::Runtim
return aFiles;
}
+namespace
+{
+
+bool lcl_matchFilter( const rtl::OUString& rFilter, const rtl::OUString& rExt )
+{
+ const int nCount = comphelper::string::getTokenCount( rFilter, ';' );
+
+ for ( int n = 0; n != nCount; ++n )
+ {
+ const rtl::OUString aToken = comphelper::string::getToken( rFilter, n, ';' );
+ if ( aToken == rExt )
+ return true;
+ }
+
+ return false;
+}
+
+}
+
uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw( uno::RuntimeException )
{
SolarMutexGuard g;
@@ -852,7 +872,7 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw( uno
++aListIter
)
{
- if( aListIter->getFilter().equalsIgnoreAsciiCase( aStarDot+sExtension ) )
+ if( lcl_matchFilter( aListIter->getFilter(), aStarDot+sExtension ) )
{
if( aNewFilter.isEmpty() )
aNewFilter = aListIter->getTitle();
--
1.8.3.1

@ -43,7 +43,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice Name: libreoffice
Epoch: 1 Epoch: 1
Version: %{libo_version}.2 Version: %{libo_version}.2
Release: 1%{?libo_prerelease}%{?dist} Release: 2%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0
Group: Applications/Productivity Group: Applications/Productivity
URL: http://www.libreoffice.org/default/ URL: http://www.libreoffice.org/default/
@ -247,6 +247,7 @@ Patch16: 0001-do-not-build-LibreOffice_Test.patch
Patch17: 0001-Resolves-rhbz-968892-force-render-full-grapheme-with.patch Patch17: 0001-Resolves-rhbz-968892-force-render-full-grapheme-with.patch
Patch18: 0001-Related-rhbz-968892-discard-impossible-languages-for.patch Patch18: 0001-Related-rhbz-968892-discard-impossible-languages-for.patch
Patch19: 0002-Related-rhbz-968892-discard-impossible-languages-for.patch Patch19: 0002-Related-rhbz-968892-discard-impossible-languages-for.patch
Patch20: 0001-rhbz-980387-fix-filter-selection-from-file-ext.patch
%define instdir %{_libdir} %define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice %define baseinstdir %{instdir}/libreoffice
@ -996,6 +997,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch17 -p1 -b .rhbz-968892-force-render-full-grapheme-with.patch %patch17 -p1 -b .rhbz-968892-force-render-full-grapheme-with.patch
%patch18 -p1 -b .rhbz-968892-discard-impossible-languages-for.patch %patch18 -p1 -b .rhbz-968892-discard-impossible-languages-for.patch
%patch19 -p1 -b .rhbz-968892-discard-impossible-languages-for.patch %patch19 -p1 -b .rhbz-968892-discard-impossible-languages-for.patch
%patch20 -p1 -b .rhbz-980387-fix-filter-selection-from-file-ext.patch
# TODO: check this # TODO: check this
# these are horribly incomplete--empty translations and copied english # these are horribly incomplete--empty translations and copied english
@ -2083,6 +2085,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif %endif
%changelog %changelog
* Thu Jul 11 2013 David Tardon <dtardon@redhat.com> - 1:4.1.0.2-2
- Resolves: rhbz#980387 Exporting a odg to jpg or tiff generates error
* Thu Jul 04 2013 David Tardon <dtardon@redhat.com> - 1:4.1.0.2-1 * Thu Jul 04 2013 David Tardon <dtardon@redhat.com> - 1:4.1.0.2-1
- 4.1.0 rc2 - 4.1.0 rc2

Loading…
Cancel
Save