~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to filters/kword/oowriter/oowriterimport.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
   You should have received a copy of the GNU Library General Public License
17
17
   along with this library; see the file COPYING.LIB.  If not, write to
18
 
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
 
   Boston, MA 02111-1307, USA.
 
18
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
 * Boston, MA 02110-1301, USA.
20
20
*/
21
21
 
22
22
#include <qcolor.h>
33
33
#include <kdebug.h>
34
34
#include <kzip.h>
35
35
 
36
 
#include <koDocumentInfo.h>
37
 
#include <koDocument.h>
 
36
#include <KoDocumentInfo.h>
 
37
#include <KoDocument.h>
38
38
 
39
39
#include <kgenericfactory.h>
40
40
#include <kmessagebox.h>
41
 
#include <koFilterChain.h>
42
 
#include <koUnit.h>
43
 
#include <koPageLayout.h>
44
 
#include <koPicture.h>
 
41
#include <KoFilterChain.h>
 
42
#include <KoUnit.h>
 
43
#include <KoPageLayout.h>
 
44
#include <KoPicture.h>
45
45
#include "conversion.h"
46
 
#include <koRect.h>
47
 
#include <kodom.h>
 
46
#include <KoRect.h>
 
47
#include <KoDom.h>
48
48
 
49
49
#if ! KDE_IS_VERSION(3,1,90)
50
50
# include <kdebugclasses.h>
1193
1193
    p.appendChild( layoutElement );
1194
1194
 
1195
1195
    // Style name
1196
 
    QString styleName = m_styleStack.userStyleName();
 
1196
    QString styleName = m_styleStack.userStyleName("paragraph");
1197
1197
    if ( !styleName.isEmpty() )
1198
1198
    {
1199
1199
        QDomElement nameElement = doc.createElement("NAME");
1595
1595
        kdWarning(30518) << "Error in text-box: neither height nor min-height specified!" << endl;
1596
1596
    }
1597
1597
 
1598
 
    int overflowBehavior;
1599
 
    if ( isText ) {
1600
 
        if ( m_styleStack.hasAttributeNS( ooNS::style, "overflow-behavior" ) ) { // OASIS extension
1601
 
            overflowBehavior = Conversion::importOverflowBehavior( m_styleStack.attributeNS( ooNS::style, "overflow-behavior" ) );
1602
 
        } else {
1603
 
            // AutoCreateNewFrame not supported in OO-1.1. The presence of min-height tells if it's an auto-resized frame.
1604
 
            overflowBehavior = hasMinHeight ? 0 /*AutoExtendFrame*/ : 2 /*Ignore, i.e. fixed size*/;
1605
 
        }
1606
 
    }
1607
 
 
1608
1598
    // draw:textarea-vertical-align, draw:textarea-horizontal-align
1609
1599
 
1610
1600
    // Not supported in KWord: fo:max-height  fo:max-width
1635
1625
    // ## runaroundGap is a problem. KWord-1.3 had one value, OO has 4 (margins on all sides, see p98).
1636
1626
    // Fixed in KWord-post-1.3, it has 4 values now.
1637
1627
 
1638
 
    // Not implemented in KWord: contour wrapping
1639
 
    if ( isText )
 
1628
 
 
1629
    if ( isText ) {
 
1630
        int overflowBehavior;
 
1631
        if ( m_styleStack.hasAttributeNS( ooNS::style, "overflow-behavior" ) ) { // OASIS extension
 
1632
            overflowBehavior = Conversion::importOverflowBehavior( m_styleStack.attributeNS( ooNS::style, "overflow-behavior" ) );
 
1633
        } else {
 
1634
            // AutoCreateNewFrame not supported in OO-1.1. The presence of min-height tells if it's an auto-resized frame.
 
1635
            overflowBehavior = hasMinHeight ? 0 /*AutoExtendFrame*/ : 2 /*Ignore, i.e. fixed size*/;
 
1636
        }
 
1637
        // Not implemented in KWord: contour wrapping
1640
1638
        frameElementOut.setAttribute("autoCreateNewFrame", overflowBehavior);
 
1639
    }
 
1640
 
1641
1641
    // TODO sheetSide (not implemented in KWord, but in its DTD)
1642
1642
 
1643
1643
    importCommonFrameProperties( frameElementOut );