[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/filters
From:       Lassi Taneli Nieminen <lassniem () gmail ! com>
Date:       2010-10-13 12:29:31
Message-ID: 20101013122931.794E1AC895 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1185455 by lassin:

Fixed regression in docx picture placing.


 M  +17 -7     kword/docx/DocxXmlDocumentReader.cpp  
 M  +3 -17     libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h  


--- trunk/koffice/filters/kword/docx/DocxXmlDocumentReader.cpp #1185454:1185455
@@ -2509,6 +2509,9 @@
 {
     READ_PROLOGUE
 
+    m_hasPosOffsetH = false;
+    m_hasPosOffsetV = false;
+
     pushCurrentDrawStyle(new KoGenStyle(KoGenStyle::GraphicAutoStyle, "graphic"));
 
     applyBorders(m_currentDrawStyle, m_textBorderStyles, m_textBorderPaddings);
@@ -2544,6 +2547,17 @@
     else {
         body->addAttribute("text:anchor-type", "char");
     }
+
+//! @todo add more cases for text:anchor-type! use m_drawing_inline and see CASE #1343
+    if (m_hasPosOffsetH) {
+        kDebug() << "m_posOffsetH" << m_posOffsetH;
+        m_svgX += m_posOffsetH;
+    }
+    if (m_hasPosOffsetV) {
+        kDebug() << "m_posOffsetV" << m_posOffsetV;
+        m_svgY += m_posOffsetV;
+    }
+
     if (!m_docPrName.isEmpty()) { // from docPr/@name
         body->addAttribute("draw:name", m_docPrName);
     }
@@ -4616,8 +4630,7 @@
 KoFilter::ConversionStatus DocxXmlDocumentReader::read_anchor()
 {
     READ_PROLOGUE
-    m_hasPosOffsetH = false;
-    m_hasPosOffsetV = false;
+
     m_docPrName.clear();
     m_docPrDescr.clear();
     m_drawing_anchor = true; // for pic:pic
@@ -4673,8 +4686,6 @@
         }
     }
 
-    m_hasPosOffsetH = false;
-    m_hasPosOffsetV = false;
     READ_EPILOGUE
 }
 
@@ -4716,6 +4727,7 @@
 KoFilter::ConversionStatus DocxXmlDocumentReader::read_inline()
 {
     READ_PROLOGUE
+
     m_docPrName.clear();
     m_docPrDescr.clear();
     m_drawing_inline = true; // for pic
@@ -4838,6 +4850,7 @@
             ELSE_WRONG_FORMAT
         }
     }
+
     READ_EPILOGUE
 }
 
@@ -4923,10 +4936,7 @@
     }
     ELSE_WRONG_FORMAT
 
-    while (!atEnd()) {
         readNext();
-        BREAK_IF_END_OF(CURRENT_EL);
-    }
     READ_EPILOGUE
 }
 
--- trunk/koffice/filters/libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h #1185454:1185455
@@ -146,10 +146,6 @@
 
     // Reset picture properties
     m_xlinkHref.clear();
-    m_hasPosOffsetH = false;
-    m_hasPosOffsetV = false;
-    m_posOffsetH = 0;
-    m_posOffsetV = 0;
     m_cNvPrId.clear();
     m_cNvPrName.clear();
     m_cNvPrDescr.clear();
@@ -205,20 +201,9 @@
         m_currentDrawStyle->addAttribute("style:fill", constNone);
     }
 
-//! @todo add more cases for text:anchor-type! use m_drawing_inline and see CASE #1343
-    int realX = m_svgX;
-    int realY = m_svgY;
-    if (m_hasPosOffsetH) {
-        kDebug() << "m_posOffsetH" << m_posOffsetH;
-        realX += m_posOffsetH;
-    }
-    if (m_hasPosOffsetV) {
-        kDebug() << "m_posOffsetV" << m_posOffsetV;
-        realY += m_posOffsetV;
-    }
     if (m_rot == 0) {
-        body->addAttribute("svg:x", EMU_TO_CM_STRING(realX));
-        body->addAttribute("svg:y", EMU_TO_CM_STRING(realY));
+        body->addAttribute("svg:x", EMU_TO_CM_STRING(m_svgX));
+        body->addAttribute("svg:y", EMU_TO_CM_STRING(m_svgY));
     }
     body->addAttribute("svg:width", EMU_TO_CM_STRING(m_svgWidth));
     body->addAttribute("svg:height", EMU_TO_CM_STRING(m_svgHeight));
@@ -2762,6 +2747,7 @@
 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_graphic()
 {
     READ_PROLOGUE
+
     while (!atEnd()) {
         readNext();
         BREAK_IF_END_OF(CURRENT_EL);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic