- bnc#875713 - LO-L3: DOCX import: picture brigtness/contrast not imported

* docx-brightness-contrast-1.diff
  * docx-brightness-contrast-2.diff

- bnc#875712 - LO-L3: DOC import: picture brigtness/contrast not imported
  * doc-brightness-contrast.diff

- bnc#870240 - LO-L3: pptx import file has text rotated on slide
  * fix-text-rotation.diff

- bnc#870234 - LO-L3: pptx file has text imported as black instead of white
  * import-gradfill-for-text-colors.diff

- bnc#870228 - LO-L3: Text inside the circle is not centered
  * text-alignment-in-shape.diff

- bnc#863021 - LO-L3: Allow setting language for slide or presentation entirely
  * set-language-in-impress.diff

- fix build on openSUSE 12.3:
  * disable-firebird-unit-test.diff

OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=154
This commit is contained in:
Andras Timar 2014-05-20 10:02:11 +00:00 committed by Git OBS Bridge
parent 6265600c73
commit 0a6b54b4d3
10 changed files with 910 additions and 1 deletions

View File

@ -0,0 +1,17 @@
diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk
index b9d7d56..146c6ee 100644
--- a/dbaccess/Module_dbaccess.mk
+++ b/dbaccess/Module_dbaccess.mk
@@ -34,12 +34,6 @@ $(eval $(call gb_Module_add_l10n_targets,dbaccess,\
UIConfig_dbtdata \
))
-ifeq ($(ENABLE_FIREBIRD_SDBC),TRUE)
-$(eval $(call gb_Module_add_check_targets,dbaccess,\
- CppunitTest_dbaccess_firebird_test \
-))
-endif
-
$(eval $(call gb_Module_add_check_targets,dbaccess,\
CppunitTest_dbaccess_dialog_save \
CppunitTest_dbaccess_macros_test \

View File

@ -0,0 +1,249 @@
From 85e088c70aa3cfdd638276a2555b35ed1275c352 Mon Sep 17 00:00:00 2001
From: Luboš Luňák <l.lunak@collabora.com>
Date: Fri, 18 Apr 2014 18:46:34 +0000
Subject: handle strange brightness+contrast adjustment from msoffice (fdo#38410)
LO uses basically the formula "newpixel=(oldpixel-128)*contrast+128+brightness",
i.e. contrast is applied first. It looks like there's no "oficial" formula for this,
so a formula that applies brightness first would be ok too. MSO for some weird reason
apparently uses a formula that applies half of brightness before contrast and
half afterwards (insert funny political correctness or compromise joke here).
While the result is the same like with the LO formula if only either brightness
or contrast is adjusted, the result is different if both are involved. Just modify
the image using the MSO algorithm if this is the case.
Conflicts:
filter/source/msfilter/msdffimp.cxx
include/vcl/bitmap.hxx
include/vcl/bitmapex.hxx
include/vcl/gdimtf.hxx
vcl/source/gdi/bitmap3.cxx
vcl/source/gdi/bitmapex.cxx
vcl/source/gdi/gdimtf.cxx
Change-Id: I55fe8f395832685b90f024cf2f58b0797c1ba588
Reviewed-on: https://gerrit.libreoffice.org/9099
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
---
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 63847b3..472e1a5 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3817,7 +3817,12 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
if ( nContrast || nBrightness || ( nGamma != 0x10000 ) || ( eDrawMode != GRAPHICDRAWMODE_STANDARD ) )
{
- if ( ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 )
+ // MSO uses a different algorithm for contrast+brightness, LO applies contrast before brightness,
+ // while MSO apparently applies half of brightness before contrast and half after. So if only
+ // contrast or brightness need to be altered, the result is the same, but if both are involved,
+ // there's no way to map that, so just force a conversion of the image.
+ bool needsConversion = nContrast != 0 && nBrightness != 0;
+ if ( ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 && !needsConversion )
{
if ( nBrightness )
rSet.Put( SdrGrafLuminanceItem( nBrightness ) );
@@ -3842,7 +3847,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
{
BitmapEx aBitmapEx( aGraf.GetBitmapEx() );
if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
- aBitmapEx.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, sal_False );
+ aBitmapEx.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, false, true );
if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
aBitmapEx.Convert( BMP_CONVERSION_8BIT_GREYS );
else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
@@ -3856,7 +3861,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
{
GDIMetaFile aGdiMetaFile( aGraf.GetGDIMetaFile() );
if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
- aGdiMetaFile.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, sal_False );
+ aGdiMetaFile.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, false, true );
if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
aGdiMetaFile.Convert( MTF_CONVERSION_8BIT_GREYS );
else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index adf6b63..621fceb 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -779,6 +779,9 @@ public:
If sal_True, invert the channel values with the logical 'not' operator
@return sal_True, if the operation was completed successfully.
+
+ @param msoBrightness
+ Use the same formula for brightness as used by MSOffice.
*/
sal_Bool Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
@@ -786,7 +789,8 @@ public:
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- sal_Bool bInvert = sal_False );
+ bool bInvert = false,
+ bool msoBrightness = false );
/** Apply specified filter to the bitmap
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index da23547..8ac6325 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -343,6 +343,10 @@ public:
If sal_True, invert the channel values with the logical 'not' operator
@return sal_True, if the operation was completed successfully.
+
+ @param msoFormula
+ Use the same formula for brightness as used by MSOffice.
+
*/
sal_Bool Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
@@ -350,7 +354,8 @@ public:
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- sal_Bool bInvert = sal_False );
+ bool bInvert = false,
+ bool msoBrightness = false );
/** Apply specified filter to the bitmap
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 8afdc14..d38f863 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -150,7 +150,7 @@ public:
void Adjust( short nLuminancePercent = 0, short nContrastPercent = 0,
short nChannelRPercent = 0, short nChannelGPercent = 0,
short nChannelBPercent = 0, double fGamma = 1.0,
- sal_Bool bInvert = sal_False
+ bool bInvert = false, bool msoBrightness = false
);
void Convert( MtfConversion eConversion );
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 5c4905a..4fbe1b8 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -3250,7 +3250,7 @@ sal_Bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, sal_uLong nFla
sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, sal_Bool bInvert )
+ double fGamma, bool bInvert, bool msoBrightness )
{
sal_Bool bRet = sal_False;
@@ -3282,8 +3282,11 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
else
fM = ( 128.0 + 1.27 * MinMax( nContrastPercent, -100L, 0L ) ) / 128.0;
- // total offset = luminance offset + contrast offset
- fOff = MinMax( nLuminancePercent, -100L, 100L ) * 2.55 + 128.0 - fM * 128.0;
+ if(!msoBrightness)
+ // total offset = luminance offset + contrast offset
+ fOff = MinMax( nLuminancePercent, -100L, 100L ) * 2.55 + 128.0 - fM * 128.0;
+ else
+ fOff = MinMax( nLuminancePercent, -100L, 100L ) * 2.55;
// channel offset = channel offset + total offset
fROff = nChannelRPercent * 2.55 + fOff;
@@ -3297,10 +3300,21 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
// create mapping table
for( nX = 0L; nX < 256L; nX++ )
{
- cMapR[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
- cMapG[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
- cMapB[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
-
+ if(!msoBrightness)
+ {
+ cMapR[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
+ cMapG[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
+ cMapB[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
+ }
+ else
+ {
+ // LO simply uses (in a somewhat optimized form) "newcolor = (oldcolor-128)*contrast+brightness+128"
+ // as the formula, i.e. contrast first, brightness afterwards. MSOffice, for whatever weird reason,
+ // use neither first, but apparently it applies half of brightness before contrast and half afterwards.
+ cMapR[ nX ] = (sal_uInt8) MinMax( FRound( (nX+fROff/2-128) * fM + 128 + fROff/2 ), 0L, 255L );
+ cMapG[ nX ] = (sal_uInt8) MinMax( FRound( (nX+fGOff/2-128) * fM + 128 + fGOff/2 ), 0L, 255L );
+ cMapB[ nX ] = (sal_uInt8) MinMax( FRound( (nX+fBOff/2-128) * fM + 128 + fBOff/2 ), 0L, 255L );
+ }
if( bGamma )
{
cMapR[ nX ] = GAMMA( cMapR[ nX ], fGamma );
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 6deb1db..98c6b24 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -633,11 +633,11 @@ sal_Bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceCol
sal_Bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, sal_Bool bInvert )
+ double fGamma, bool bInvert, bool msoBrightness )
{
return( !!aBitmap ? aBitmap.Adjust( nLuminancePercent, nContrastPercent,
nChannelRPercent, nChannelGPercent, nChannelBPercent,
- fGamma, bInvert ) : sal_False );
+ fGamma, bInvert, msoBrightness ) : false );
}
sal_Bool BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 2e74172..12ad981 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2175,7 +2175,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent,
- short nChannelBPercent, double fGamma, sal_Bool bInvert )
+ short nChannelBPercent, double fGamma, bool bInvert, bool msoBrightness )
{
// nothing to do? => return quickly
if( nLuminancePercent || nContrastPercent ||
@@ -2196,8 +2196,11 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
else
fM = ( 128.0 + 1.27 * MinMax( nContrastPercent, -100L, 0L ) ) / 128.0;
- // total offset = luminance offset + contrast offset
- fOff = MinMax( nLuminancePercent, -100L, 100L ) * 2.55 + 128.0 - fM * 128.0;
+ if(!msoBrightness)
+ // total offset = luminance offset + contrast offset
+ fOff = MinMax( nLuminancePercent, -100L, 100L ) * 2.55 + 128.0 - fM * 128.0;
+ else
+ fOff = MinMax( nLuminancePercent, -100L, 100L ) * 2.55;
// channel offset = channel offset + total offset
fROff = nChannelRPercent * 2.55 + fOff;
@@ -2211,10 +2214,18 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
// create mapping table
for( long nX = 0L; nX < 256L; nX++ )
{
- aColParam.pMapR[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
- aColParam.pMapG[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
- aColParam.pMapB[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
-
+ if(!msoBrightness)
+ {
+ aColParam.pMapR[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
+ aColParam.pMapG[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
+ aColParam.pMapB[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
+ }
+ else
+ {
+ aColParam.pMapR[ nX ] = (sal_uInt8) MinMax( FRound( (nX+fROff/2-128) * fM + 128 + fROff/2 ), 0L, 255L );
+ aColParam.pMapG[ nX ] = (sal_uInt8) MinMax( FRound( (nX+fGOff/2-128) * fM + 128 + fGOff/2 ), 0L, 255L );
+ aColParam.pMapB[ nX ] = (sal_uInt8) MinMax( FRound( (nX+fBOff/2-128) * fM + 128 + fBOff/2 ), 0L, 255L );
+ }
if( bGamma )
{
aColParam.pMapR[ nX ] = GAMMA( aColParam.pMapR[ nX ], fGamma );
--
cgit v0.9.0.2-2-gbebe

View File

@ -0,0 +1,30 @@
From 02dcf4a9b7387f6675324245ab2fa5b7eabf0d12 Mon Sep 17 00:00:00 2001
From: Luboš Luňák <l.lunak@collabora.com>
Date: Wed, 30 Apr 2014 19:52:28 +0000
Subject: actually read brightness/contrast when reading docx (bnc#875713)
It's read for the shape in oox/ , but it didn't make it any further apparently.
Change-Id: I0885a675f72d63b3d262f1ef7e42f5d2e03588b6
(cherry picked from commit 804da2a977989ba1f046847b9e00f00c83749e30)
Reviewed-on: https://gerrit.libreoffice.org/9216
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
---
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 304a3d2..607d92b 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -924,6 +924,10 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
xShapeProps->getPropertyValue("ShadowTransparence") >>= m_pImpl->nShadowTransparence;
}
+ xShapeProps->getPropertyValue("GraphicColorMode") >>= m_pImpl->eColorMode;
+ xShapeProps->getPropertyValue("AdjustLuminance") >>= m_pImpl->nBrightness;
+ xShapeProps->getPropertyValue("AdjustContrast") >>= m_pImpl->nContrast;
+
// fdo#70457: transform XShape into a SwXTextGraphicObject only if there's no rotation
if ( nRotation == 0 )
m_xGraphicObject = createGraphicObject( aMediaProperties );
--
cgit v0.9.0.2-2-gbebe

View File

@ -0,0 +1,143 @@
From 75a839188d1cac5f0ac602e59462b32879d2242a Mon Sep 17 00:00:00 2001
From: Luboš Luňák <l.lunak@collabora.com>
Date: Wed, 30 Apr 2014 20:19:08 +0000
Subject: handle brightness+contrast from msoffice (bnc#875713)
This is the same like 1139d618b8bc6ab823a96184bd0f0257980aad24, for docx.
(cherry picked from commit 893fe88469dec5b727d96f8ea1b4edb9e88288a7)
Conflicts:
oox/source/drawingml/fillproperties.cxx
Change-Id: I1ef4e18444e8c60e9ae8f67249bcef1053f0d62d
Reviewed-on: https://gerrit.libreoffice.org/9217
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
---
diff --git a/offapi/com/sun/star/graphic/XGraphicTransformer.idl b/offapi/com/sun/star/graphic/XGraphicTransformer.idl
index d1a6ddf..dbd9c8d 100644
--- a/offapi/com/sun/star/graphic/XGraphicTransformer.idl
+++ b/offapi/com/sun/star/graphic/XGraphicTransformer.idl
@@ -51,6 +51,16 @@ interface XGraphicTransformer : ::com::sun::star::uno::XInterface
com::sun::star::graphic::XGraphic applyDuotone( [ in ] com::sun::star::graphic::XGraphic In,
[ in ] long ColorOne, [ in ] long ColorTwo )
raises( ::com::sun::star::lang::IllegalArgumentException );
+
+ /** changes brightness/contrast
+
+ @param mso whether to use MSOffice brightness/contrast formula
+ @returns
+ The modified graphic
+ */
+ com::sun::star::graphic::XGraphic applyBrightnessContrast( [ in ] com::sun::star::graphic::XGraphic In,
+ [ in ] long brightness, [ in ] long contrast, [ in ] boolean mso )
+ raises( ::com::sun::star::lang::IllegalArgumentException );
};
} ; } ; } ; } ;
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index c96c77a..99026a9 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -92,6 +92,18 @@ Reference< XGraphic > lclCheckAndApplyChangeColorTransform( const BlipFillProper
return xGraphic;
}
+Reference< XGraphic > applyBrightnessContrast( Reference< XGraphic > xGraphic, sal_Int32 brightness, sal_Int32 contrast )
+{
+ try
+ {
+ Reference< XGraphicTransformer > xTransformer( xGraphic, UNO_QUERY_THROW );
+ xGraphic = xTransformer->applyBrightnessContrast( xGraphic, brightness, contrast, true );
+ }
+ catch( Exception& )
+ {
+ }
+ return xGraphic;
+}
BitmapMode lclGetBitmapMode( sal_Int32 nToken )
@@ -501,12 +513,24 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr ) const
{
+ sal_Int16 nBrightness = getLimitedValue< sal_Int16, sal_Int32 >( maBlipProps.moBrightness.get( 0 ) / PER_PERCENT, -100, 100 );
+ sal_Int16 nContrast = getLimitedValue< sal_Int16, sal_Int32 >( maBlipProps.moContrast.get( 0 ) / PER_PERCENT, -100, 100 );
if( maBlipProps.mxGraphic.is() )
{
// created transformed graphic
Reference< XGraphic > xGraphic = lclCheckAndApplyDuotoneTransform( maBlipProps, maBlipProps.mxGraphic, rGraphicHelper, nPhClr );
xGraphic = lclCheckAndApplyChangeColorTransform( maBlipProps, xGraphic, rGraphicHelper, nPhClr );
+ // MSO uses a different algorithm for contrast+brightness, LO applies contrast before brightness,
+ // while MSO apparently applies half of brightness before contrast and half after. So if only
+ // contrast or brightness need to be altered, the result is the same, but if both are involved,
+ // there's no way to map that, so just force a conversion of the image.
+ if( nBrightness != 0 && nContrast != 0 )
+ {
+ xGraphic = applyBrightnessContrast( xGraphic, nBrightness, nContrast );
+ nBrightness = 0;
+ nContrast = 0;
+ }
rPropMap[ PROP_Graphic ] <<= xGraphic;
// do we still need to set GraphicURL as well? (TODO)
@@ -545,10 +569,8 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
rPropMap[ PROP_GraphicColorMode ] <<= eColorMode;
// brightness and contrast
- sal_Int16 nBrightness = getLimitedValue< sal_Int16, sal_Int32 >( maBlipProps.moBrightness.get( 0 ) / PER_PERCENT, -100, 100 );
if( nBrightness != 0 )
rPropMap[ PROP_AdjustLuminance ] <<= nBrightness;
- sal_Int16 nContrast = getLimitedValue< sal_Int16, sal_Int32 >( maBlipProps.moContrast.get( 0 ) / PER_PERCENT, -100, 100 );
if( nContrast != 0 )
rPropMap[ PROP_AdjustContrast ] <<= nContrast;
diff --git a/svtools/source/graphic/transformer.cxx b/svtools/source/graphic/transformer.cxx
index 30f07c7..bf63621 100644
--- a/svtools/source/graphic/transformer.cxx
+++ b/svtools/source/graphic/transformer.cxx
@@ -159,6 +159,23 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::applyDuotone(
return xRet;
}
+uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::applyBrightnessContrast(
+ const uno::Reference< graphic::XGraphic >& rxGraphic, sal_Int32 nBrightness, sal_Int32 nContrast, sal_Bool mso )
+ throw ( lang::IllegalArgumentException, uno::RuntimeException, std::exception)
+{
+ const uno::Reference< uno::XInterface > xIFace( rxGraphic, uno::UNO_QUERY );
+ ::Graphic aGraphic( *::unographic::Graphic::getImplementation( xIFace ) );
+
+ BitmapEx aBitmapEx( aGraphic.GetBitmapEx() );
+ aBitmapEx.Adjust( nBrightness, nContrast, 0, 0, 0, 0, false, mso );
+ aGraphic = ::Graphic( aBitmapEx );
+
+ ::unographic::Graphic* pUnoGraphic = new ::unographic::Graphic();
+ pUnoGraphic->init( aGraphic );
+ uno::Reference< graphic::XGraphic > xRet( pUnoGraphic );
+ return xRet;
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/transformer.hxx b/svtools/source/graphic/transformer.hxx
index e57b8fa..1707183 100644
--- a/svtools/source/graphic/transformer.hxx
+++ b/svtools/source/graphic/transformer.hxx
@@ -51,6 +51,11 @@ class GraphicTransformer : public GraphicTransformer_UnoImplHelper1
sal_Int32 nColorOne, sal_Int32 nColorTwo )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL applyBrightnessContrast(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic,
+ sal_Int32 nBrightness, sal_Int32 nContrast, sal_Bool mso )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
};
}
--
cgit v0.9.0.2-2-gbebe

26
fix-text-rotation.diff Normal file
View File

@ -0,0 +1,26 @@
From e3e12b1d1e36e1a0d4fc4c6423b584d677693897 Mon Sep 17 00:00:00 2001
From: Muthu Subramanian <sumuthu@collabora.com>
Date: Wed, 26 Mar 2014 10:35:44 +0000
Subject: n#862510: Fix text rotation.
Fix breaks document in n#783433 - the one there is
damaged - resaving it using mso 2010 should fix the problem there.
Change-Id: Ib2ee7ab20489d716dc189ac6810d705763a16476
---
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index e232b4d..0a1bb59 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -46,7 +46,8 @@ Transform2DContext::Transform2DContext( ContextHandler2Helper& rParent, const At
}
else
{
- mrShape.getTextBody()->getTextProperties().moRotation = rAttribs.getInteger( XML_rot );
+ if( rAttribs.hasAttribute( XML_rot ) )
+ mrShape.getTextBody()->getTextProperties().moRotation = -rAttribs.getInteger( XML_rot ).get();
}
}
--
cgit v0.9.0.2-2-gbebe

View File

@ -0,0 +1,75 @@
From ce609f477e488e9c701b2bfa893bcf01722d2a01 Mon Sep 17 00:00:00 2001
From: Muthu Subramanian <sumuthu@collabora.com>
Date: Fri, 28 Mar 2014 11:54:45 +0000
Subject: n#870234: Import gradfill for text colors.
Uses the first color from the gradfill list.
(Which is better than plain black!)
(cherry picked from commit cfc76de83e3c0a56abd30a8f3bd7c69d3500d223)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Conflicts:
oox/source/drawingml/textcharacterproperties.cxx
oox/source/drawingml/textcharacterpropertiescontext.cxx
Change-Id: I4c1c0c4b031f3681c95b75b3c0683eb4de95bffb
---
diff --git a/include/oox/drawingml/textcharacterproperties.hxx b/include/oox/drawingml/textcharacterproperties.hxx
index c079015..d2335e1 100644
--- a/include/oox/drawingml/textcharacterproperties.hxx
+++ b/include/oox/drawingml/textcharacterproperties.hxx
@@ -24,6 +24,7 @@
#include <oox/helper/propertymap.hxx>
#include <oox/drawingml/color.hxx>
#include <oox/drawingml/textfont.hxx>
+#include <oox/drawingml/fillproperties.hxx>
namespace oox { class PropertySet; }
@@ -53,6 +54,7 @@ struct TextCharacterProperties
OptValue< bool > moItalic;
OptValue< bool > moUnderlineLineFollowText;
OptValue< bool > moUnderlineFillFollowText;
+ GradientFillProperties maGradientProps; /// Properties for gradient text colors
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed( const TextCharacterProperties& rSourceProps );
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index febb28c..a7be42b 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -60,6 +60,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
moItalic.assignIfUsed( rSourceProps.moItalic );
moUnderlineLineFollowText.assignIfUsed( rSourceProps.moUnderlineLineFollowText );
moUnderlineFillFollowText.assignIfUsed( rSourceProps.moUnderlineFillFollowText );
+ maGradientProps.assignUsed( rSourceProps.maGradientProps );
}
void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter, bool bUseOptional ) const
@@ -93,6 +94,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if( maCharColor.isUsed() )
rPropMap[ PROP_CharColor ] <<= maCharColor.getColor( rFilter.getGraphicHelper() );
+ if( maGradientProps.maGradientStops.size() > 0 )
+ rPropMap[ PROP_CharColor ] <<= maGradientProps.maGradientStops.begin()->second.getColor( rFilter.getGraphicHelper() );
if( moLang.has() && !moLang.get().isEmpty() )
{
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index e166e6d..6887cda 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -132,6 +132,10 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
case A_TOKEN( hlinkClick ): // CT_Hyperlink
case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink
return new HyperLinkContext( *this, rAttribs, mrTextCharacterProperties.maHyperlinkPropertyMap );
+
+ case A_TOKEN( gradFill ):
+ return new GradientFillContext( *this, rAttribs, mrTextCharacterProperties.maGradientProps );
+
}
return this;
--
cgit v0.9.0.2-2-gbebe

View File

@ -1,5 +1,48 @@
-------------------------------------------------------------------
Fri May 16 10:20:00 UTC 2014 - timar@fsf.hu
Tue May 20 08:17:29 UTC 2014 - andras.timar@collabora.com
- bnc#875713 - LO-L3: DOCX import: picture brigtness/contrast not imported
* docx-brightness-contrast-1.diff
* docx-brightness-contrast-2.diff
-------------------------------------------------------------------
Tue May 20 08:11:28 UTC 2014 - andras.timar@collabora.com
- bnc#875712 - LO-L3: DOC import: picture brigtness/contrast not imported
* doc-brightness-contrast.diff
-------------------------------------------------------------------
Tue May 20 08:05:13 UTC 2014 - andras.timar@collabora.com
- bnc#870240 - LO-L3: pptx import file has text rotated on slide
* fix-text-rotation.diff
-------------------------------------------------------------------
Tue May 20 07:55:57 UTC 2014 - andras.timar@collabora.com
- bnc#870234 - LO-L3: pptx file has text imported as black instead of white
* import-gradfill-for-text-colors.diff
-------------------------------------------------------------------
Tue May 20 07:51:16 UTC 2014 - andras.timar@collabora.com
- bnc#870228 - LO-L3: Text inside the circle is not centered
* text-alignment-in-shape.diff
-------------------------------------------------------------------
Tue May 20 07:38:00 UTC 2014 - andras.timar@collabora.com
- bnc#863021 - LO-L3: Allow setting language for slide or presentation entirely
* set-language-in-impress.diff
-------------------------------------------------------------------
Tue May 20 07:27:24 UTC 2014 - andras.timar@collabora.com
- fix build on openSUSE 12.3:
* disable-firebird-unit-test.diff
-------------------------------------------------------------------
Fri May 16 10:20:00 UTC 2014 - andras.timar@collabora.com
- fix build on openSUSE 12.3:
* 0001-std-strlen-requires-cstring-include-to-build.patch

View File

@ -91,6 +91,21 @@ Patch16: wizards-create-temlates-with-python-2.6.diff
Patch18: kde4-4.2.3.3-timer-mutex.patch
# Fix build on openSUSE 12.3
Patch19: 0001-std-strlen-requires-cstring-include-to-build.patch
# disable Firebird unit test which fails on openSUSE 12.3 (it's an experimental feature anyway)
Patch20: disable-firebird-unit-test.diff
# bnc#863021 - LO-L3: Allow setting language for slide or presentation entirely
Patch21: set-language-in-impress.diff
# bnc#870228 - LO-L3: Text inside the circle is not centered
Patch22: text-alignment-in-shape.diff
# bnc#870234 - LO-L3: pptx file has text imported as black instead of white
Patch23: import-gradfill-for-text-colors.diff
# bnc#870240 - LO-L3: pptx import file has text rotated on slide
Patch24: fix-text-rotation.diff
# bnc#875712 - LO-L3: DOC import: picture brigtness/contrast not imported
Patch25: doc-brightness-contrast.diff
# bnc#875713 - LO-L3: DOCX import: picture brigtness/contrast not imported
Patch26: docx-brightness-contrast-1.diff
Patch27: docx-brightness-contrast-2.diff
# try to save space by using hardlinks
Patch990: install-with-hardlinks.diff
BuildRequires: ImageMagick
@ -853,6 +868,14 @@ Provides additional %{langname} translations and resources for %{project}. \
%patch16 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch990 -p1
# 256x256 icons
tar -xjf %{SOURCE20}

View File

@ -0,0 +1,245 @@
From d5aedeef765d60c7420ada7eba8405cfe448c6a8 Mon Sep 17 00:00:00 2001
From: Muthu Subramanian <sumuthu@collabora.com>
Date: Wed, 23 Apr 2014 18:33:22 +0530
Subject: [PATCH] fdo#64047: n#863021: Add set-all language menu.
Problems:
* Doesn't reset the spell error markers
* Modifies only at object level
* Currently has only setting for 'all text'
* Maybe provide a current slide only option?
Change-Id: I4695423fed3ed9422185b23803eedd12ef434bea
(cherry picked from commit 0833f4046a1afa77aeed97a131c5325c44be1bb3)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
---
sd/sdi/_docsh.sdi | 15 ++--
sd/source/ui/docshell/docshel3.cxx | 114 +++++++++++++++++++++++++++++++
sd/source/ui/docshell/docshell.cxx | 6 ++
sd/uiconfig/sdraw/menubar/menubar.xml | 2 +
sd/uiconfig/simpress/menubar/menubar.xml | 2 +
5 files changed, 134 insertions(+), 5 deletions(-)
diff --git a/sd/sdi/_docsh.sdi b/sd/sdi/_docsh.sdi
index 075b60a..b087723 100644
--- a/sd/sdi/_docsh.sdi
+++ b/sd/sdi/_docsh.sdi
@@ -32,11 +32,16 @@ interface DrawDocument
ExecMethod = Execute ;
StateMethod = GetState ;
]
- SID_CHINESE_CONVERSION // ole : ?, status : ?
- [
- ExecMethod = Execute ;
- StateMethod = GetState ;
- ]
+ SID_CHINESE_CONVERSION // ole : ?, status : ?
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
+ SID_LANGUAGE_STATUS
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
// ?
FID_SEARCH_NOW // ole : ?, status : ?
[
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index d22f50a..cd45b39 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include "Window.hxx"
#include "DrawDocShell.hxx"
#include "app.hrc"
@@ -28,11 +29,18 @@
#include <svx/svxerr.hxx>
#include <svx/dialmgr.hxx>
#include <svl/srchitem.hxx>
+#include <svl/languageoptions.hxx>
+#include <svtools/langtab.hxx>
#include <svx/srchdlg.hxx>
#include <sfx2/request.hxx>
+#include <sfx2/sfxdlg.hxx>
+#include <vcl/abstdlg.hxx>
+#include <vcl/window.hxx>
#include <svl/style.hxx>
#include <svx/drawitem.hxx>
#include <editeng/unolingu.hxx>
+#include <editeng/langitem.hxx>
+#include <editeng/eeitem.hxx>
#include <com/sun/star/i18n/TextConversionOption.hpp>
#include "strings.hrc"
@@ -55,6 +63,68 @@ using namespace ::com::sun::star::uno;
namespace sd {
+static void lcl_setLanguageForObj( SdrObject *pObj, LanguageType nLang, bool bLanguageNone = false )
+{
+ const sal_uInt16 aLangWhichId_EE[3] =
+ {
+ EE_CHAR_LANGUAGE,
+ EE_CHAR_LANGUAGE_CJK,
+ EE_CHAR_LANGUAGE_CTL
+ };
+
+ if( bLanguageNone )
+ nLang = LANGUAGE_NONE;
+
+ if( nLang != LANGUAGE_DONTKNOW )
+ {
+ if( nLang == LANGUAGE_NONE )
+ {
+ for(sal_Int32 n = 0; n < 3; n++ )
+ pObj->SetMergedItem( SvxLanguageItem( nLang, aLangWhichId_EE[n] ) );
+ }
+ else
+ {
+ sal_uInt16 nLangWhichId = 0;
+ sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLang );
+ switch (nScriptType)
+ {
+ case SCRIPTTYPE_LATIN : nLangWhichId = EE_CHAR_LANGUAGE; break;
+ case SCRIPTTYPE_ASIAN : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break;
+ case SCRIPTTYPE_COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
+ default:
+ OSL_FAIL("unexpected case" );
+ return;
+ }
+ pObj->SetMergedItem( SvxLanguageItem( nLang, nLangWhichId ) );
+ }
+ }
+ else // Reset to default
+ {
+ for( sal_Int32 n = 0; n < 3; n++ )
+ pObj->ClearMergedItem( aLangWhichId_EE[n] );
+ }
+}
+
+
+static void lcl_setLanguage( const SdDrawDocument *pDoc, const OUString &rLanguage, bool bLanguageNone = false )
+{
+ LanguageType nLang = SvtLanguageTable().GetType( rLanguage );
+
+ // Do it for SdDrawDocument->SetLanguage as well?
+
+ sal_uInt16 nPageCount = pDoc->GetPageCount(); // Pick All Pages
+ for( sal_uInt16 nPage = 0; nPage < nPageCount; nPage++ )
+ {
+ const SdrPage *pPage = pDoc->GetPage( nPage );
+ sal_uIntPtr nObjCount = pPage->GetObjCount();
+ for( sal_uInt16 nObj = 0; nObj < nObjCount; nObj++ )
+ {
+ SdrObject *pObj = pPage->GetObj( nObj );
+ lcl_setLanguageForObj( pObj, nLang, bLanguageNone );
+ }
+ }
+}
+
/**
* Handles SFX-Requests
*/
@@ -201,6 +271,50 @@ void DrawDocShell::Execute( SfxRequest& rReq )
}
}
break;
+ case SID_LANGUAGE_STATUS:
+ {
+ OUString aNewLangTxt;
+ SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, SID_LANGUAGE_STATUS , false );
+ if (pItem)
+ aNewLangTxt = pItem->GetValue();
+ if (aNewLangTxt == "*" )
+ {
+ // open the dialog "Tools/Options/Language Settings - Language"
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+ if (pFact && mpViewShell)
+ {
+ VclAbstractDialog* pDlg = pFact->CreateVclDialog( mpViewShell->GetActiveWindow(), SID_LANGUAGE_OPTIONS );
+ pDlg->Execute();
+ delete pDlg;
+ }
+ }
+ else
+ {
+ // setting the new language...
+ if (!aNewLangTxt.isEmpty())
+ {
+ const OUString aDocumentLangPrefix("Default_");
+ const OUString aStrNone("LANGUAGE_NONE");
+ const OUString aStrResetLangs("RESET_LANGUAGES");
+ sal_Int32 nPos = -1;
+ if (-1 != (nPos = aNewLangTxt.indexOf( aDocumentLangPrefix , 0 )))
+ {
+ aNewLangTxt = aNewLangTxt.replaceAt( nPos, aDocumentLangPrefix.getLength(), "" );
+ }
+ else
+ {
+ break;
+ }
+ if (aNewLangTxt == aStrNone)
+ lcl_setLanguage( mpViewShell->GetDoc(), OUString() );
+ else if (aNewLangTxt == aStrResetLangs)
+ lcl_setLanguage( mpViewShell->GetDoc(), OUString(), true );
+ else
+ lcl_setLanguage( mpViewShell->GetDoc(), aNewLangTxt );
+ }
+ }
+ }
+ break;
default:
break;
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 1553954..ee0fad0 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -270,6 +270,12 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
rSet.Put(SfxVisibilityItem(nWhich, SvtCJKOptions().IsAnyEnabled()));
}
break;
+ case SID_LANGUAGE_STATUS:
+ {
+ // Keeping this enabled for the time being
+ rSet.Put(SfxVisibilityItem(nWhich, true));
+ }
+ break;
default:
break;
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index 6e8f9e4..289acf9 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -245,6 +245,8 @@
<menu:menuitem menu:id=".uno:SpellDialog"/>
<menu:menu menu:id=".uno:LanguageMenu">
<menu:menupopup>
+ <menu:menuitem menu:id=".uno:SetLanguageAllTextMenu"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:HangulHanjaConversion"/>
<menu:menuitem menu:id=".uno:ChineseConversion"/>
<menu:menuitem menu:id=".uno:ThesaurusDialog"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index b2d5ae6..e8b1a6d 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -273,6 +273,8 @@
<menu:menuitem menu:id=".uno:SpellDialog"/>
<menu:menu menu:id=".uno:LanguageMenu">
<menu:menupopup>
+ <menu:menuitem menu:id=".uno:SetLanguageAllTextMenu"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:HangulHanjaConversion"/>
<menu:menuitem menu:id=".uno:ChineseConversion"/>
<menu:menuitem menu:id=".uno:ThesaurusDialog"/>
--
1.8.4.5

View File

@ -0,0 +1,58 @@
From 709f06eb261b3225cd4b56a7efb8e2d591909960 Mon Sep 17 00:00:00 2001
From: Muthu Subramanian <sumuthu@collabora.com>
Date: Wed, 26 Mar 2014 10:43:08 +0000
Subject: n#862510: anchorCtr controls the anchoring as well.
(cherry picked from commit c17eb67460293fbe72ffa8e80cd10743df493afa)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Conflicts:
oox/source/drawingml/textbodypropertiescontext.cxx
Change-Id: Ib244d89a9f7d400b3891d477314cd5f0193552e0
---
diff --git a/include/oox/drawingml/textbodyproperties.hxx b/include/oox/drawingml/textbodyproperties.hxx
index 3fb0684..af68f20 100644
--- a/include/oox/drawingml/textbodyproperties.hxx
+++ b/include/oox/drawingml/textbodyproperties.hxx
@@ -34,6 +34,7 @@ struct TextBodyProperties
{
PropertyMap maPropertyMap;
OptValue< sal_Int32 > moRotation;
+ bool mbAnchorCtr;
OptValue< sal_Int32 > moVert;
boost::optional< sal_Int32 > moInsets[4];
boost::optional< sal_Int32 > moTextOffX;
diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx
index 36f39d9..9e53897 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -80,8 +80,8 @@ void TextBodyProperties::pushRotationAdjustments( sal_Int32 nRotation )
// Hack for n#760986
// TODO: Preferred method would be to have a textbox on top
// of the shape and the place it according to the (off,ext)
- if( nOff == 0 && moTextOffX ) nVal = *moTextOffX;
- if( nOff == 1 && moTextOffY ) nVal = *moTextOffY;
+ if( nOff == 0 && moTextOffX && mbAnchorCtr ) nVal = *moTextOffX;
+ if( nOff == 1 && moTextOffY && mbAnchorCtr ) nVal = *moTextOffY;
if( nVal < 0 ) nVal = 0;
if( moInsets[i] )
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index 358db9f..b580be3 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -56,9 +56,9 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper& rPa
mrTextBodyProp.moInsets[i] = GetCoordinate( sValue );
}
- bool bAnchorCenter = rAttribs.getBool( XML_anchorCtr, false );
+ mrTextBodyProp.mbAnchorCtr = rAttribs.getBool( XML_anchorCtr, false );
if( rAttribs.hasAttribute( XML_anchorCtr ) ) {
- if( bAnchorCenter )
+ if( mrTextBodyProp.mbAnchorCtr )
mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
TextHorizontalAdjust_CENTER;
}
--
cgit v0.9.0.2-2-gbebe