Commits

Anonymous committed 2a9ed9a

Moved a module-wise visible function to a static function since it's only called in that file.

Also, added ScPhonetic member to ScMyCell.

  • Participants
  • Parent commits f046e95

Comments (0)

Files changed (4)

sc/inc/cellsuno.hxx

 	virtual sal_Int16 SAL_CALL resetActionLocks() throw(::com::sun::star::uno::RuntimeException);
 
 	static String		GetOutputString_Impl(ScDocument* pDoc, const ScAddress& aPos);
-
-    /**
-     * Gets phonetic text from a cell. 
-     *  
-     * @param pDoc A pointer of ScDocument.
-     * @param aPos A reference of ScAdress.
-     */
-    static String GetOutputPhoneticString_Impl(ScDocument* pDoc, const ScAddress& aPos);
 };
 
 

sc/source/filter/xml/XMLExportIterator.hxx

 #include "global.hxx"
 #include "detfunc.hxx"
 #include "detdata.hxx"
+#include "phonetic.hxx"
 
 class	ScHorizontalCellIterator;
 struct	ScMyCell;
 	rtl::OUString				sStringValue;
 	rtl::OUString				sAnnotationText;
     rtl::OUString               sPhoneticText;
+    ScPhonetic                  aPhoneticData;
 
 	ScMyAreaLink				aAreaLink;
 	ScMyShapeList				aShapeList;

sc/source/filter/xml/xmlexprt.cxx

 	return sal_False;*/
 }
 
+namespace {
+
+String GetOutputPhoneticData_Impl(ScDocument* pDoc, const ScAddress& aCellPos)
+{
+    String aVal;
+    if ( pDoc )
+    {
+        ScBaseCell* pCell = pDoc->GetCell( aCellPos );
+        if ( pCell && pCell->GetCellType() == CELLTYPE_STRING &&
+             static_cast<const ScStringCell*>(pCell)->HasPhonetic() )
+        {
+            ScPhonetic aPhonetic;
+            static_cast<const ScAsianStringCell*>(pCell)->GetPhonetic(aPhonetic);
+            if ( !aPhonetic.IsEmpty() )
+                aVal = aPhonetic.GetString();
+        }
+        else if ( pCell && pCell->GetCellType() == CELLTYPE_EDIT && 
+                  static_cast<const ScEditCell*>(pCell)->HasPhonetic() )
+        {
+            ScPhonetic aPhonetic;
+            static_cast<const ScAsianEditCell*>(pCell)->GetPhonetic(aPhonetic);
+            if ( !aPhonetic.IsEmpty() )
+                aVal = aPhonetic.GetString();
+        }
+    }
+    return aVal;
+}
+
+}
+
 sal_Bool ScXMLExport::GetCellText (ScMyCell& rMyCell, const ScAddress& aPos) const
 {
 	if (rMyCell.bHasStringValue)
 		return sal_True;
-	else
-	{
-/*		if (!rMyCell.bHasXText)
-		{
-            rMyCell.xText.set(xCurrentTableCellRange->getCellByPosition(rMyCell.aCellAddress.Column, rMyCell.aCellAddress.Row), uno::UNO_QUERY);
-			rMyCell.bHasXText = sal_True;
-		}*/
-//		if (rMyCell.xText.is())
-//		{
-            rMyCell.sStringValue = ScCellObj::GetOutputString_Impl(pDoc, aPos);
-			rMyCell.bHasStringValue = sal_True;
-            rMyCell.sPhoneticText = ScCellObj::GetOutputPhoneticString_Impl(pDoc, aPos);
-            rMyCell.bHasPhonetic = sal_True;
-			return sal_True;
-//		}
-	}
+
+    rMyCell.sStringValue = ScCellObj::GetOutputString_Impl(pDoc, aPos);
+    rMyCell.bHasStringValue = sal_True;
+    rMyCell.sPhoneticText = GetOutputPhoneticData_Impl(pDoc, aPos);
+    rMyCell.bHasPhonetic = sal_True;
+    return sal_True;
 }
 
 void ScXMLExport::WriteRubyText (ScMyCell& rMyCell)
 {
     if ( !rMyCell.sPhoneticText.getLength() )
         return;
+
     StartElement( XML_NAMESPACE_TEXT, XML_RUBY, sal_False);
     StartElement( XML_NAMESPACE_TEXT, XML_RUBY_BASE, sal_False );
     Characters( rMyCell.sStringValue );

sc/source/ui/unoobj/cellsuno.cxx

 	return aVal;
 }
 
-String ScCellObj::GetOutputPhoneticString_Impl(ScDocument* pDoc, const ScAddress& aCellPos)
-{
-    String aVal;
-    if ( pDoc )
-    {
-        ScBaseCell* pCell = pDoc->GetCell( aCellPos );
-        if ( pCell && pCell->GetCellType() == CELLTYPE_STRING &&
-             static_cast<const ScStringCell*>(pCell)->HasPhonetic() )
-        {
-            ScPhonetic aPhonetic;
-            static_cast<const ScAsianStringCell*>(pCell)->GetPhonetic(aPhonetic);
-            if ( !aPhonetic.IsEmpty() )
-                aVal = aPhonetic.GetString();
-        }
-        else if ( pCell && pCell->GetCellType() == CELLTYPE_EDIT && 
-                  static_cast<const ScEditCell*>(pCell)->HasPhonetic() )
-        {
-            ScPhonetic aPhonetic;
-            static_cast<const ScAsianEditCell*>(pCell)->GetPhonetic(aPhonetic);
-            if ( !aPhonetic.IsEmpty() )
-                aVal = aPhonetic.GetString();
-        }
-    }
-    return aVal;
-}
-
 String ScCellObj::GetOutputString_Impl() const
 {
 	ScDocShell* pDocSh = GetDocShell();