[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - oox/source sw/qa
oox/source/drawingml/shape.cxx |5 +++- oox/source/drawingml/textbodypropertiescontext.cxx | 11 + oox/source/drawingml/transform2dcontext.cxx|2 - sw/qa/extras/ooxmlimport/data/fdo87488.docx|binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 25 +++-- 5 files changed, 35 insertions(+), 8 deletions(-) New commits: commit b8fdf370d8732d39d6739e320aa1450ead5a31b7 Author: Gary Houston ghous...@arglist.com Date: Sat Dec 20 15:41:15 2014 +1100 fdo#87488 Wrong text rotation inside a preset shape from docx Preset shape text rotation values are read in a few places and stored in moRotation. With these changes, moRotation is always read unchanged, but multiplied by -1 when it's used. Change-Id: I633d665c21daa69e15fa828a43300f10d2bf2054 Reviewed-on: https://gerrit.libreoffice.org/13561 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk (cherry picked from commit 921cea89da8adbe714ea8f71169dd6afc42354c4) Signed-off-by: Andras Timar andras.ti...@collabora.com Reviewed-on: https://gerrit.libreoffice.org/15083 diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index f8fdda6..db36b56 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1011,7 +1011,10 @@ Reference XShape Shape::createAndInsert( if( getTextBody() ) { sal_Int32 nTextRotateAngle = static_cast sal_Int32 ( getTextBody()-getTextProperties().moRotation.get( 0 ) ); -mpCustomShapePropertiesPtr-setTextRotateAngle( nTextRotateAngle / 6 ); +/* OOX measures text rotation clockwise in 1/6th degrees, + relative to the containing shape. setTextRotateAngle wants + degrees anticlockwise. */ +mpCustomShapePropertiesPtr-setTextRotateAngle( -1 * nTextRotateAngle / 6 ); } SAL_INFO(oox.cscode, ==cscode== shape name: ' msName '); diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 89167b6..cc27437 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -84,13 +84,16 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper rPa // ST_TextVerticalType if( rAttribs.hasAttribute( XML_vert ) ) { mrTextBodyProp.moVert = rAttribs.getToken( XML_vert ); -bool bRtl = rAttribs.getBool( XML_rtl, false ); sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz ); -if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) -mrTextBodyProp.moRotation = -540*(tVert==XML_vert270?3:1); -else +if (tVert == XML_vert || tVert == XML_eaVert || tVert == XML_mongolianVert) +mrTextBodyProp.moRotation = 540; +else if (tVert == XML_vert270) +mrTextBodyProp.moRotation = 540 * 3; +else { +bool bRtl = rAttribs.getBool( XML_rtl, false ); mrTextBodyProp.maPropertyMap.setProperty( PROP_TextWritingMode, ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB )); +} } // ST_TextAnchoringType diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx index a6a39eb..10bd727 100644 --- a/oox/source/drawingml/transform2dcontext.cxx +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -48,7 +48,7 @@ Transform2DContext::Transform2DContext( ContextHandler2Helper rParent, const At else { if( rAttribs.hasAttribute( XML_rot ) ) -mrShape.getTextBody()-getTextProperties().moRotation = -rAttribs.getInteger( XML_rot ).get(); +mrShape.getTextBody()-getTextProperties().moRotation = rAttribs.getInteger( XML_rot ).get(); } } diff --git a/sw/qa/extras/ooxmlimport/data/fdo87488.docx b/sw/qa/extras/ooxmlimport/data/fdo87488.docx new file mode 100644 index 000..2bd51b6 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo87488.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 471095c..f71e03e 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -76,13 +76,13 @@ public: virtual void preTest(const char* filename) SAL_OVERRIDE { -if (OString(filename) == smartart.docx || OString(filename) == strict-smartart.docx) +if (OString(filename) == smartart.docx || OString(filename) == strict-smartart.docx || OString(filename) == fdo87488.docx) SvtFilterOptions::Get().SetSmartArt2Shape(true); } virtual void postTest(const char* filename) SAL_OVERRIDE { -if (OString
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sw/qa
oox/source/drawingml/shape.cxx |5 +++- oox/source/drawingml/textbodypropertiescontext.cxx | 11 + oox/source/drawingml/transform2dcontext.cxx|2 - sw/qa/extras/ooxmlimport/data/fdo87488.docx|binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 25 +++-- 5 files changed, 35 insertions(+), 8 deletions(-) New commits: commit 89032c4b7344139b7e3608d09e8c63b3eafd534b Author: Gary Houston ghous...@arglist.com Date: Sat Dec 20 15:41:15 2014 +1100 fdo#87488 Wrong text rotation inside a preset shape from docx Preset shape text rotation values are read in a few places and stored in moRotation. With these changes, moRotation is always read unchanged, but multiplied by -1 when it's used. Change-Id: I633d665c21daa69e15fa828a43300f10d2bf2054 Reviewed-on: https://gerrit.libreoffice.org/13561 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk (cherry picked from commit 921cea89da8adbe714ea8f71169dd6afc42354c4) Signed-off-by: Andras Timar andras.ti...@collabora.com Reviewed-on: https://gerrit.libreoffice.org/15084 diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index ef0feb7..7fea778 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -999,7 +999,10 @@ Reference XShape Shape::createAndInsert( if( getTextBody() ) { sal_Int32 nTextRotateAngle = static_cast sal_Int32 ( getTextBody()-getTextProperties().moRotation.get( 0 ) ); -mpCustomShapePropertiesPtr-setTextRotateAngle( nTextRotateAngle / 6 ); +/* OOX measures text rotation clockwise in 1/6th degrees, + relative to the containing shape. setTextRotateAngle wants + degrees anticlockwise. */ +mpCustomShapePropertiesPtr-setTextRotateAngle( -1 * nTextRotateAngle / 6 ); } SAL_INFO(oox.cscode, ==cscode== shape name: ' msName '); diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 80d82a0..f0208b5 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -84,13 +84,16 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper rPa // ST_TextVerticalType if( rAttribs.hasAttribute( XML_vert ) ) { mrTextBodyProp.moVert = rAttribs.getToken( XML_vert ); -bool bRtl = rAttribs.getBool( XML_rtl, false ); sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz ); -if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) -mrTextBodyProp.moRotation = -540*(tVert==XML_vert270?3:1); -else +if (tVert == XML_vert || tVert == XML_eaVert || tVert == XML_mongolianVert) +mrTextBodyProp.moRotation = 540; +else if (tVert == XML_vert270) +mrTextBodyProp.moRotation = 540 * 3; +else { +bool bRtl = rAttribs.getBool( XML_rtl, false ); mrTextBodyProp.maPropertyMap.setProperty( PROP_TextWritingMode, ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB )); +} } // ST_TextAnchoringType diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx index d3f7f5e..97015f3 100644 --- a/oox/source/drawingml/transform2dcontext.cxx +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -47,7 +47,7 @@ Transform2DContext::Transform2DContext( ContextHandler2Helper rParent, const At else { if( rAttribs.hasAttribute( XML_rot ) ) -mrShape.getTextBody()-getTextProperties().moRotation = -rAttribs.getInteger( XML_rot ).get(); +mrShape.getTextBody()-getTextProperties().moRotation = rAttribs.getInteger( XML_rot ).get(); } } diff --git a/sw/qa/extras/ooxmlimport/data/fdo87488.docx b/sw/qa/extras/ooxmlimport/data/fdo87488.docx new file mode 100644 index 000..2bd51b6 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo87488.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 44876b9..c4bc13a 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -73,13 +73,13 @@ public: virtual void preTest(const char* filename) SAL_OVERRIDE { -if (OString(filename) == smartart.docx || OString(filename) == strict-smartart.docx) +if (OString(filename) == smartart.docx || OString(filename) == strict-smartart.docx || OString(filename) == fdo87488.docx) SvtFilterOptions::Get().SetSmartArt2Shape(true); } virtual void postTest(const char* filename) SAL_OVERRIDE { -if (OString
[Libreoffice-commits] core.git: oox/source sw/qa
oox/source/drawingml/shape.cxx |5 +++- oox/source/drawingml/textbodypropertiescontext.cxx | 11 + oox/source/drawingml/transform2dcontext.cxx|2 - sw/qa/extras/ooxmlimport/data/fdo87488.docx|binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 25 +++-- 5 files changed, 35 insertions(+), 8 deletions(-) New commits: commit 921cea89da8adbe714ea8f71169dd6afc42354c4 Author: Gary Houston ghous...@arglist.com Date: Sat Dec 20 15:41:15 2014 +1100 fdo#87488 Wrong text rotation inside a preset shape from docx Preset shape text rotation values are read in a few places and stored in moRotation. With these changes, moRotation is always read unchanged, but multiplied by -1 when it's used. Change-Id: I633d665c21daa69e15fa828a43300f10d2bf2054 Reviewed-on: https://gerrit.libreoffice.org/13561 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 7fdfefd..59350e2 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1014,7 +1014,10 @@ Reference XShape Shape::createAndInsert( if( getTextBody() ) { sal_Int32 nTextRotateAngle = static_cast sal_Int32 ( getTextBody()-getTextProperties().moRotation.get( 0 ) ); -mpCustomShapePropertiesPtr-setTextRotateAngle( nTextRotateAngle / 6 ); +/* OOX measures text rotation clockwise in 1/6th degrees, + relative to the containing shape. setTextRotateAngle wants + degrees anticlockwise. */ +mpCustomShapePropertiesPtr-setTextRotateAngle( -1 * nTextRotateAngle / 6 ); } SAL_INFO(oox.cscode, ==cscode== shape name: ' msName '); diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 89167b6..cc27437 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -84,13 +84,16 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper rPa // ST_TextVerticalType if( rAttribs.hasAttribute( XML_vert ) ) { mrTextBodyProp.moVert = rAttribs.getToken( XML_vert ); -bool bRtl = rAttribs.getBool( XML_rtl, false ); sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz ); -if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) -mrTextBodyProp.moRotation = -540*(tVert==XML_vert270?3:1); -else +if (tVert == XML_vert || tVert == XML_eaVert || tVert == XML_mongolianVert) +mrTextBodyProp.moRotation = 540; +else if (tVert == XML_vert270) +mrTextBodyProp.moRotation = 540 * 3; +else { +bool bRtl = rAttribs.getBool( XML_rtl, false ); mrTextBodyProp.maPropertyMap.setProperty( PROP_TextWritingMode, ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB )); +} } // ST_TextAnchoringType diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx index a6a39eb..10bd727 100644 --- a/oox/source/drawingml/transform2dcontext.cxx +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -48,7 +48,7 @@ Transform2DContext::Transform2DContext( ContextHandler2Helper rParent, const At else { if( rAttribs.hasAttribute( XML_rot ) ) -mrShape.getTextBody()-getTextProperties().moRotation = -rAttribs.getInteger( XML_rot ).get(); +mrShape.getTextBody()-getTextProperties().moRotation = rAttribs.getInteger( XML_rot ).get(); } } diff --git a/sw/qa/extras/ooxmlimport/data/fdo87488.docx b/sw/qa/extras/ooxmlimport/data/fdo87488.docx new file mode 100644 index 000..2bd51b6 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo87488.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 7e8c62d..c1b0d95 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -78,13 +78,13 @@ public: virtual void preTest(const char* filename) SAL_OVERRIDE { -if (OString(filename) == smartart.docx || OString(filename) == strict-smartart.docx) +if (OString(filename) == smartart.docx || OString(filename) == strict-smartart.docx || OString(filename) == fdo87488.docx) SvtFilterOptions::Get().SetSmartArt2Shape(true); } virtual void postTest(const char* filename) SAL_OVERRIDE { -if (OString(filename) == smartart.docx || OString(filename) == strict-smartart.docx) +if (OString(filename) == smartart.docx || OString(filename) == strict-smartart.docx || OString(filename
Gary Houston license statement
All of my past future contributions to LibreOffice may be licensed under the MPLv2/LGPLv3+ dual license. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: 3 commits - include/vcl oox/source vcl/source
include/vcl/svapp.hxx | 12 -- oox/source/drawingml/diagram/diagramdefinitioncontext.cxx |4 vcl/source/app/svapp.cxx | 15 -- vcl/source/window/settings.cxx| 80 -- 4 files changed, 3 insertions(+), 108 deletions(-) New commits: commit de41a2038ac44f71a9adef97e6ccea83c99dd1c2 Author: Gary Houston ghous...@arglist.com Date: Mon Dec 15 14:25:31 2014 + Resolves: fdo#87281 Crash on importing diagram in .docx file Change-Id: Ic2c7326ab83258e2e9dcbac88aa9f76f771a9b12 diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx index 7f43761..88b69f2 100644 --- a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx +++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx @@ -48,7 +48,9 @@ DiagramDefinitionContext::DiagramDefinitionContext( ContextHandler2Helper rPare DiagramDefinitionContext::~DiagramDefinitionContext() { -mpLayout-getNode()-dump(0); +LayoutNodePtr node = mpLayout-getNode(); +if (node) +node-dump(0); } ContextHandlerRef commit e2a41b4415f59c2c6a75f40775a19c8ce4cbdb42 Author: Caolán McNamara caol...@redhat.com Date: Mon Dec 15 14:04:08 2014 + don't screw around with the system font selection Change-Id: I491a6410f70b063fd74834d5837be34e4b9552d7 diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx index 6525240..862626e 100644 --- a/vcl/source/window/settings.cxx +++ b/vcl/source/window/settings.cxx @@ -154,86 +154,6 @@ void Window::ImplUpdateGlobalSettings( AllSettings rSettings, bool bCallHdl ) rSettings.SetStyleSettings( aTmpSt ); ImplGetFrame()-UpdateSettings( rSettings ); -// Verify availability of the configured UI font, otherwise choose Andale Sans UI - -// WTF, what makes Andale Sans UI a suitable cross-platform fallback font? - -OUString aUserInterfaceFont; -bool bUseSystemFont = rSettings.GetStyleSettings().GetUseSystemUIFonts(); - -// check whether system UI font can display a typical UI text -if( bUseSystemFont ) -bUseSystemFont = ImplCheckUIFont( rSettings.GetStyleSettings().GetAppFont() ); - -if ( !bUseSystemFont ) -{ -OutputDevice *pOutDev = GetOutDev(); -pOutDev-ImplInitFontList(); -OUString aConfigFont = utl::DefaultFontConfiguration::get().getUserInterfaceFont( rSettings.GetUILanguageTag() ); -sal_Int32 nIndex = 0; -while( nIndex != -1 ) -{ -OUString aName( aConfigFont.getToken( 0, ';', nIndex ) ); -if ( !aName.isEmpty() mpWindowImpl-mpFrameData-mpFontCollection-FindFontFamily( aName ) ) -{ -aUserInterfaceFont = aConfigFont; -break; -} -} - -if ( aUserInterfaceFont.isEmpty() ) -{ -OUString aFallbackFont (Andale Sans UI ); -if ( mpWindowImpl-mpFrameData-mpFontCollection-FindFontFamily( aFallbackFont ) ) -aUserInterfaceFont = aFallbackFont; -} -} - -if ( !bUseSystemFont !aUserInterfaceFont.isEmpty() ) -{ -StyleSettings aStyleSettings = rSettings.GetStyleSettings(); -vcl::Font aFont = aStyleSettings.GetAppFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetAppFont( aFont ); -aFont = aStyleSettings.GetHelpFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetHelpFont( aFont ); -aFont = aStyleSettings.GetTitleFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetTitleFont( aFont ); -aFont = aStyleSettings.GetFloatTitleFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetFloatTitleFont( aFont ); -aFont = aStyleSettings.GetMenuFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetMenuFont( aFont ); -aFont = aStyleSettings.GetToolFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetToolFont( aFont ); -aFont = aStyleSettings.GetLabelFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetLabelFont( aFont ); -aFont = aStyleSettings.GetInfoFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetInfoFont( aFont ); -aFont = aStyleSettings.GetRadioCheckFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetRadioCheckFont( aFont ); -aFont = aStyleSettings.GetPushButtonFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetPushButtonFont( aFont ); -aFont = aStyleSettings.GetFieldFont(); -aFont.SetName( aUserInterfaceFont ); -aStyleSettings.SetFieldFont( aFont ); -aFont = aStyleSettings.GetIconFont(); -aFont.SetName( aUserInterfaceFont
[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - oox/source
oox/source/drawingml/diagram/diagramdefinitioncontext.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 84ce458a841f9b09b87ff045403b546c88c79168 Author: Gary Houston ghous...@arglist.com Date: Mon Dec 15 14:25:31 2014 + Resolves: fdo#87281 Crash on importing diagram in .docx file Change-Id: Ic2c7326ab83258e2e9dcbac88aa9f76f771a9b12 (cherry picked from commit de41a2038ac44f71a9adef97e6ccea83c99dd1c2) diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx index 7f43761..88b69f2 100644 --- a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx +++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx @@ -48,7 +48,9 @@ DiagramDefinitionContext::DiagramDefinitionContext( ContextHandler2Helper rPare DiagramDefinitionContext::~DiagramDefinitionContext() { -mpLayout-getNode()-dump(0); +LayoutNodePtr node = mpLayout-getNode(); +if (node) +node-dump(0); } ContextHandlerRef ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits