[Libreoffice-commits] .: writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 3 06:04:01 PDT 2012


 writerfilter/source/dmapper/DomainMapper.cxx |   18 ++++++++++++++++--
 writerfilter/source/dmapper/PropertyMap.hxx  |    2 +-
 2 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 3413841785496171a7a91a371355a7efc6ca0a2f
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Thu Sep 20 18:26:03 2012 +0200

    probably a rather ugly hack for inline text frame in a table (bnc#780851)
    
    Change-Id: I2bd76799cf0a5da09664d0e1b1a9adb466633be1

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 64618bf..c5a42a9 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1273,8 +1273,22 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
                             case  NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_center  :nIntValue = text::VertOrientation::CENTER;break;
                             case  NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_bottom  :
                             case  NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_outside :nIntValue = text::VertOrientation::BOTTOM;break;
-                            case  NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inline  ://todo: what to do with inline - no avail. in WW97 and WW2007
-                            //no break;
+                            case  NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inline  :
+                            {
+                            // HACK: This is for bnc#780851, where a table has one cell that has w:framePr,
+                            // which causes that paragraph to be converted to a text frame, and the original
+                            // paragraph object no longer exists, which makes table creation fail and futhermore
+                            // it would be missing in the table layout anyway. So actually no letting that paragraph
+                            // be a text frame "fixes" it. I'm not sure what "inline" is supposed to mean in practice
+                            // anyway, so as long as this doesn't cause trouble elsewhere ...
+                                PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH);
+                                if( pContext.get() )
+                                {
+                                    ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pContext.get() );
+                                    pParaContext->SetFrameMode(false);
+                                }
+                                nIntValue = text::VertOrientation::NONE;
+                            }
                             default:nIntValue = text::VertOrientation::NONE;
                         }
                         pParaProperties->SetyAlign( nIntValue );
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index fc88ddb..d19988a 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -305,7 +305,7 @@ public:
 
     int operator==(const ParagraphProperties&); //does not compare the starting/ending range, m_sParaStyleName and m_nDropCapLength
 
-    void    SetFrameMode() { m_bFrameMode = true; }
+    void    SetFrameMode( bool set = true ) { m_bFrameMode = set; }
     bool    IsFrameMode()const { return m_bFrameMode; }
 
     void SetDropCap( sal_Int32 nSet ) { m_nDropCap = nSet; }


More information about the Libreoffice-commits mailing list