[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Wed Jan 26 06:45:34 PST 2011


 sw/source/filter/ww8/docxexport.hxx |    5 ++---
 sw/source/filter/ww8/rtfexport.hxx  |    4 ++--
 sw/source/filter/ww8/wrtw8nds.cxx   |    6 +++---
 sw/source/filter/ww8/wrtw8num.cxx   |    4 ++--
 sw/source/filter/ww8/wrtww8.cxx     |    2 +-
 sw/source/filter/ww8/wrtww8.hxx     |    7 +++----
 6 files changed, 13 insertions(+), 15 deletions(-)

New commits:
commit 9c6c75080b1f9d5956160adfb06916901502a191
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Wed Jan 26 15:36:50 2011 +0100

    MSWordExportBase::SupportsUnicode(): renamed from HackIsWW8OrHigher
    
    That mathod is basically used to determine if unicode is allowed to be
    used during the export, but the old names wasn't that meaningful.
    
    Suggested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 6d1a056..9e7a0c5 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -95,9 +95,8 @@ public:
     /// Access to the sections/headers/footres.
     virtual MSWordSections& Sections() const;
 
-    /// Hack, unfortunately necessary at some places for now.
-    /// FIXME remove it when possible.
-    virtual bool HackIsWW8OrHigher() const { return true; }
+    /// Determines if the format is expected to support unicode.
+    virtual bool SupportsUnicode() const { return true; }
 
     virtual bool ignoreAttributeForStyles( USHORT nWhich ) const;
 
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index 0516d72..f7f4d21 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -82,8 +82,8 @@ public:
     /// Access to the Rtf Sdr exporter.
     virtual RtfSdrExport& SdrExporter() const;
 
-    /// Hack, unfortunately necessary at some places for now.
-    virtual bool HackIsWW8OrHigher() const { return true; }
+    /// Determines if the format is expected to support unicode.
+    virtual bool SupportsUnicode() const { return true; }
 
     /// Guess the script (asian/western).
     virtual bool CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich );
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index bafc7aa..26df9cb 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -189,7 +189,7 @@ void SwWW8AttrIter::IterToCurrent()
 SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) :
     MSWordAttrIter(rWr),
     rNd(rTxtNd),
-    maCharRuns(GetPseudoCharRuns(rTxtNd, 0, !rWr.HackIsWW8OrHigher())),
+    maCharRuns(GetPseudoCharRuns(rTxtNd, 0, !rWr.SupportsUnicode())),
     pCurRedline(0),
     nAktSwPos(0),
     nCurRedlinePos(USHRT_MAX),
@@ -218,7 +218,7 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) :
      only be supported by word anchored inline ("as character"), so force
      this in the supportable case.
     */
-    if (rWr.HackIsWW8OrHigher() && rWr.bInWriteEscher)
+    if (rWr.SupportsUnicode() && rWr.bInWriteEscher)
     {
         std::for_each(maFlyFrms.begin(), maFlyFrms.end(),
             std::mem_fun_ref(&sw::Frame::ForceTreatAsInline));
@@ -514,7 +514,7 @@ void SwWW8AttrIter::OutAttr( xub_StrLen nSwPos, bool bRuby )
          this makes older nonunicode aware versions of word display the correct
          characters.
         */
-        if ( !m_rExport.HackIsWW8OrHigher() )
+        if ( !m_rExport.SupportsUnicode() )
             aFont.GetCharSet() = GetCharSet();
 
         if ( rParentFont != aFont )
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 56b68dc..284d43f 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -468,7 +468,7 @@ void MSWordExportBase::AbstractNumberingDefinitions()
                         sFontName = pBulletFont->GetName();
 
                     pPseudoFont = new wwFont( sFontName, pBulletFont->GetPitch(),
-                        eFamily, eChrSet, HackIsWW8OrHigher() );
+                        eFamily, eChrSet, SupportsUnicode() );
                 }
                 else
                     pOutSet = &rFmt.GetCharFmt()->GetAttrSet();
@@ -738,7 +738,7 @@ void MSWordExportBase::SubstituteBullet( String& rNumStr,
         rFontName = sFont;
         rChrSet = RTL_TEXTENCODING_SYMBOL;
     }
-    else if ( HackIsWW8OrHigher() &&
+    else if ( SupportsUnicode() &&
         (rNumStr.GetChar(0) < 0xE000 || rNumStr.GetChar(0) > 0xF8FF) )
     {
         /*
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 239d143..a219792 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2928,7 +2928,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
                                      nsRedlineMode_t::REDLINE_SHOW_INSERT) );
     }
 
-    maFontHelper.InitFontTable( HackIsWW8OrHigher(), *pDoc );
+    maFontHelper.InitFontTable( SupportsUnicode(), *pDoc );
     GatherChapterFields();
 
     CollectOutlineBookmarks(*pDoc);
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 5d47b4d..945f40e 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -619,9 +619,8 @@ public:
     /// Access to the sections/headers/footres.
     virtual MSWordSections& Sections() const = 0;
 
-    /// Hack, unfortunately necessary at some places for now.
-    /// FIXME remove it when possible.
-    virtual bool HackIsWW8OrHigher() const = 0;
+    /// Determines if the format is expected to support unicode.
+    virtual bool SupportsUnicode() const = 0;
 
     /// Used to filter out attributes that can be e.g. written to .doc but not to .docx
     virtual bool ignoreAttributeForStyles( USHORT /*nWhich*/ ) const { return false; }
@@ -926,7 +925,7 @@ public:
     virtual MSWordSections& Sections() const;
 
     /// False for WW6, true for WW8.
-    virtual bool HackIsWW8OrHigher() const { return bWrtWW8; }
+    virtual bool SupportsUnicode() const { return bWrtWW8; }
 
 private:
     /// Format-dependant part of the actual export.


More information about the Libreoffice-commits mailing list