corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmke...@apache.org
Subject [83/92] [abbrv] incubator-corinthia git commit: Move CSSClassNames.c into Word filter
Date Wed, 17 Dec 2014 13:29:33 GMT
Move CSSClassNames.c into Word filter

This file references the WordSetupTableGridStyle function defined in the
OOXML filter, which we're not supposed to be accessing from core.
Although all the rest of the code here is generic in nature, in that it
could conceivably be used by other filters in the future, to resolve the
dependency issue we'll put this file into the OOXML filter for the time
being.


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/368597e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/368597e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/368597e7

Branch: refs/heads/stable
Commit: 368597e77f7dce232701df2f377d024db2bef26a
Parents: 58ddc77
Author: Peter Kelly <peter@uxproductivity.com>
Authored: Tue Dec 9 21:24:27 2014 +0700
Committer: Peter Kelly <peter@uxproductivity.com>
Committed: Tue Dec 9 21:24:27 2014 +0700

----------------------------------------------------------------------
 DocFormats.xcodeproj/project.pbxproj            |  60 +--
 DocFormats/CMakeLists.txt                       |   4 +-
 DocFormats/core/src/css/CSSClassNames.c         | 405 -------------------
 DocFormats/core/src/css/CSSClassNames.h         |  25 --
 .../filters/ooxml/src/word/CSSClassNames.c      | 405 +++++++++++++++++++
 .../filters/ooxml/src/word/CSSClassNames.h      |  25 ++
 6 files changed, 462 insertions(+), 462 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/368597e7/DocFormats.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/DocFormats.xcodeproj/project.pbxproj b/DocFormats.xcodeproj/project.pbxproj
index 2b7ee55..9164e6a 100644
--- a/DocFormats.xcodeproj/project.pbxproj
+++ b/DocFormats.xcodeproj/project.pbxproj
@@ -33,10 +33,6 @@
 		D01E24681A205A1500F4C04D /* CSS.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E24181A205A1500F4C04D /* CSS.c */; };
 		D01E24691A205A1500F4C04D /* CSS.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E24191A205A1500F4C04D /* CSS.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D01E246A1A205A1500F4C04D /* CSS.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E24191A205A1500F4C04D /* CSS.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		D01E246B1A205A1500F4C04D /* CSSClassNames.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E241A1A205A1500F4C04D /* CSSClassNames.c */; };
-		D01E246C1A205A1500F4C04D /* CSSClassNames.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E241A1A205A1500F4C04D /* CSSClassNames.c */; };
-		D01E246D1A205A1500F4C04D /* CSSClassNames.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E241B1A205A1500F4C04D /* CSSClassNames.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		D01E246E1A205A1500F4C04D /* CSSClassNames.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E241B1A205A1500F4C04D /* CSSClassNames.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D01E246F1A205A1500F4C04D /* CSSLength.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E241C1A205A1500F4C04D /* CSSLength.c */; };
 		D01E24701A205A1500F4C04D /* CSSLength.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E241C1A205A1500F4C04D /* CSSLength.c */; };
 		D01E24711A205A1500F4C04D /* CSSLength.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E241D1A205A1500F4C04D /* CSSLength.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -111,8 +107,6 @@
 		D01E24B61A205A1500F4C04D /* DFCharacterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E24411A205A1500F4C04D /* DFCharacterSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D01E24B71A205A1500F4C04D /* DFError.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E24421A205A1500F4C04D /* DFError.c */; };
 		D01E24B81A205A1500F4C04D /* DFError.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E24421A205A1500F4C04D /* DFError.c */; };
-		D01E24B91A205A1500F4C04D /* DFError.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E24431A205A1500F4C04D /* DFError.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		D01E24BA1A205A1500F4C04D /* DFError.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E24431A205A1500F4C04D /* DFError.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D01E24BB1A205A1500F4C04D /* DFFilesystem.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E24441A205A1500F4C04D /* DFFilesystem.c */; };
 		D01E24BC1A205A1500F4C04D /* DFFilesystem.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E24441A205A1500F4C04D /* DFFilesystem.c */; };
 		D01E24BD1A205A1500F4C04D /* DFFilesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E24451A205A1500F4C04D /* DFFilesystem.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -153,8 +147,6 @@
 		D01E24E41A205A1500F4C04D /* DFXML.c in Sources */ = {isa = PBXBuildFile; fileRef = D01E245A1A205A1500F4C04D /* DFXML.c */; };
 		D01E24E51A205A1500F4C04D /* DFXML.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E245B1A205A1500F4C04D /* DFXML.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D01E24E61A205A1500F4C04D /* DFXML.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E245B1A205A1500F4C04D /* DFXML.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		D01E24E71A205A1500F4C04D /* DFXMLForward.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E245C1A205A1500F4C04D /* DFXMLForward.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		D01E24E81A205A1500F4C04D /* DFXMLForward.h in Headers */ = {isa = PBXBuildFile; fileRef = D01E245C1A205A1500F4C04D /* DFXMLForward.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D0416D171A2DD7F20064BE57 /* Formats.h in Headers */ = {isa = PBXBuildFile; fileRef = D0416D161A2DD7F20064BE57 /* Formats.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D0416D181A2DD7F40064BE57 /* Formats.h in Headers */ = {isa = PBXBuildFile; fileRef = D0416D161A2DD7F20064BE57 /* Formats.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D0416D1A1A2DD8060064BE57 /* Formats.c in Sources */ = {isa = PBXBuildFile; fileRef = D0416D191A2DD8060064BE57 /* Formats.c */; };
@@ -179,11 +171,13 @@
 		D074ED591A2B04BC000C3704 /* Operations.h in Headers */ = {isa = PBXBuildFile; fileRef = D074ED571A2B04BC000C3704 /* Operations.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D078117A1A35801200768ACF /* DFStorage.c in Sources */ = {isa = PBXBuildFile; fileRef = D07811781A35801200768ACF /* DFStorage.c */; };
 		D078117B1A35801200768ACF /* DFStorage.c in Sources */ = {isa = PBXBuildFile; fileRef = D07811781A35801200768ACF /* DFStorage.c */; };
-		D078117C1A35801200768ACF /* DFStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = D07811791A35801200768ACF /* DFStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		D078117D1A35801200768ACF /* DFStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = D07811791A35801200768ACF /* DFStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D0A1283317EF7E9D005FE158 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A1283217EF7E9D005FE158 /* Cocoa.framework */; };
 		D0A1283D17EF7E9D005FE158 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D0A1283B17EF7E9D005FE158 /* InfoPlist.strings */; };
 		D0A1286317EF7ED5005FE158 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A1286217EF7ED5005FE158 /* Foundation.framework */; };
+		D0A278AB1A373C8D00CE7C2E /* CSSClassNames.c in Sources */ = {isa = PBXBuildFile; fileRef = D0A278A91A373C8D00CE7C2E /* CSSClassNames.c */; };
+		D0A278AC1A373C8D00CE7C2E /* CSSClassNames.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A278AA1A373C8D00CE7C2E /* CSSClassNames.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D0A278AD1A373C9100CE7C2E /* CSSClassNames.c in Sources */ = {isa = PBXBuildFile; fileRef = D0A278A91A373C8D00CE7C2E /* CSSClassNames.c */; };
+		D0A278AE1A373C9400CE7C2E /* CSSClassNames.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A278AA1A373C8D00CE7C2E /* CSSClassNames.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D0A786881A210EA900723FE8 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A7839D1A210EA700723FE8 /* crypt.h */; };
 		D0A786891A210EA900723FE8 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A7839D1A210EA700723FE8 /* crypt.h */; };
 		D0A7868A1A210EA900723FE8 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = D0A7839E1A210EA700723FE8 /* ioapi.c */; };
@@ -436,6 +430,12 @@
 		D0B113CD1A205F67009610A5 /* HTMLToLaTeX.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B113CB1A205F67009610A5 /* HTMLToLaTeX.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D0B113CE1A205F70009610A5 /* HTMLToLaTeX.c in Sources */ = {isa = PBXBuildFile; fileRef = D0B113CA1A205F67009610A5 /* HTMLToLaTeX.c */; };
 		D0B113CF1A205F70009610A5 /* HTMLToLaTeX.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B113CB1A205F67009610A5 /* HTMLToLaTeX.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D0B50BAB1A373BE50015076A /* DFXMLForward.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B50BAA1A373BE50015076A /* DFXMLForward.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D0B50BAC1A373BE70015076A /* DFXMLForward.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B50BAA1A373BE50015076A /* DFXMLForward.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D0B50BAF1A373C080015076A /* DFError.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B50BAD1A373C080015076A /* DFError.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D0B50BB01A373C080015076A /* DFError.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B50BAD1A373C080015076A /* DFError.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D0B50BB11A373C080015076A /* DFStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B50BAE1A373C080015076A /* DFStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D0B50BB21A373C080015076A /* DFStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B50BAE1A373C080015076A /* DFStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		D0B5E8B517F086BD00FBD99F /* FileClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0B5E8B417F086BD00FBD99F /* FileClient.framework */; };
 		D0B5E8B717F086C100FBD99F /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D0B5E8B617F086C100FBD99F /* libxml2.dylib */; };
 		D0B5E8B917F086C700FBD99F /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D0B5E8B817F086C700FBD99F /* libz.dylib */; };
@@ -475,8 +475,6 @@
 		D01E24161A205A1500F4C04D /* DFTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFTable.h; sourceTree = "<group>"; };
 		D01E24181A205A1500F4C04D /* CSS.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CSS.c; sourceTree = "<group>"; };
 		D01E24191A205A1500F4C04D /* CSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSS.h; sourceTree = "<group>"; };
-		D01E241A1A205A1500F4C04D /* CSSClassNames.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CSSClassNames.c; sourceTree = "<group>"; };
-		D01E241B1A205A1500F4C04D /* CSSClassNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSClassNames.h; sourceTree = "<group>"; };
 		D01E241C1A205A1500F4C04D /* CSSLength.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CSSLength.c; sourceTree = "<group>"; };
 		D01E241D1A205A1500F4C04D /* CSSLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSLength.h; sourceTree = "<group>"; };
 		D01E241E1A205A1500F4C04D /* CSSParser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CSSParser.c; sourceTree = "<group>"; };
@@ -514,7 +512,6 @@
 		D01E24401A205A1500F4C04D /* DFCharacterSet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DFCharacterSet.c; sourceTree = "<group>"; };
 		D01E24411A205A1500F4C04D /* DFCharacterSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFCharacterSet.h; sourceTree = "<group>"; };
 		D01E24421A205A1500F4C04D /* DFError.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DFError.c; sourceTree = "<group>"; };
-		D01E24431A205A1500F4C04D /* DFError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFError.h; sourceTree = "<group>"; };
 		D01E24441A205A1500F4C04D /* DFFilesystem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DFFilesystem.c; sourceTree = "<group>"; };
 		D01E24451A205A1500F4C04D /* DFFilesystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFFilesystem.h; sourceTree = "<group>"; };
 		D01E24461A205A1500F4C04D /* DFHashTable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DFHashTable.c; sourceTree = "<group>"; };
@@ -535,7 +532,6 @@
 		D01E24591A205A1500F4C04D /* DFNameMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFNameMap.h; sourceTree = "<group>"; };
 		D01E245A1A205A1500F4C04D /* DFXML.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DFXML.c; sourceTree = "<group>"; };
 		D01E245B1A205A1500F4C04D /* DFXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFXML.h; sourceTree = "<group>"; };
-		D01E245C1A205A1500F4C04D /* DFXMLForward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFXMLForward.h; sourceTree = "<group>"; };
 		D0416D161A2DD7F20064BE57 /* Formats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Formats.h; path = api/headers/DocFormats/Formats.h; sourceTree = "<group>"; };
 		D0416D191A2DD8060064BE57 /* Formats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Formats.c; path = api/src/Formats.c; sourceTree = "<group>"; };
 		D044592F1A20635B00A2E37E /* ODF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ODF.c; sourceTree = "<group>"; };
@@ -549,7 +545,6 @@
 		D074ED561A2B04BC000C3704 /* DocFormats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DocFormats.h; path = api/headers/DocFormats/DocFormats.h; sourceTree = "<group>"; };
 		D074ED571A2B04BC000C3704 /* Operations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Operations.h; path = api/headers/DocFormats/Operations.h; sourceTree = "<group>"; };
 		D07811781A35801200768ACF /* DFStorage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DFStorage.c; sourceTree = "<group>"; };
-		D07811791A35801200768ACF /* DFStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFStorage.h; sourceTree = "<group>"; };
 		D0A1282F17EF7E9D005FE158 /* DocFormats.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DocFormats.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		D0A1283217EF7E9D005FE158 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
 		D0A1283517EF7E9D005FE158 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -562,6 +557,8 @@
 		D0A1286117EF7ED5005FE158 /* libDocFormats.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDocFormats.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		D0A1286217EF7ED5005FE158 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
 		D0A1287217EF7ED5005FE158 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
+		D0A278A91A373C8D00CE7C2E /* CSSClassNames.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CSSClassNames.c; sourceTree = "<group>"; };
+		D0A278AA1A373C8D00CE7C2E /* CSSClassNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSClassNames.h; sourceTree = "<group>"; };
 		D0A7839D1A210EA700723FE8 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = "<group>"; };
 		D0A7839E1A210EA700723FE8 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = "<group>"; };
 		D0A7839F1A210EA700723FE8 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi.h; sourceTree = "<group>"; };
@@ -688,6 +685,9 @@
 		D0ADB32F1A2054C6003D645D /* WordWhitespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordWhitespace.h; sourceTree = "<group>"; };
 		D0B113CA1A205F67009610A5 /* HTMLToLaTeX.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = HTMLToLaTeX.c; sourceTree = "<group>"; };
 		D0B113CB1A205F67009610A5 /* HTMLToLaTeX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLToLaTeX.h; sourceTree = "<group>"; };
+		D0B50BAA1A373BE50015076A /* DFXMLForward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFXMLForward.h; path = DocFormats/api/headers/DocFormats/DFXMLForward.h; sourceTree = SOURCE_ROOT; };
+		D0B50BAD1A373C080015076A /* DFError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFError.h; path = DocFormats/api/headers/DocFormats/DFError.h; sourceTree = SOURCE_ROOT; };
+		D0B50BAE1A373C080015076A /* DFStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFStorage.h; path = DocFormats/api/headers/DocFormats/DFStorage.h; sourceTree = SOURCE_ROOT; };
 		D0B5E8B417F086BD00FBD99F /* FileClient.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FileClient.framework; path = ../FileClient/build/Debug/FileClient.framework; sourceTree = "<group>"; };
 		D0B5E8B617F086C100FBD99F /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
 		D0B5E8B817F086C700FBD99F /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
@@ -781,8 +781,6 @@
 			children = (
 				D01E24181A205A1500F4C04D /* CSS.c */,
 				D01E24191A205A1500F4C04D /* CSS.h */,
-				D01E241A1A205A1500F4C04D /* CSSClassNames.c */,
-				D01E241B1A205A1500F4C04D /* CSSClassNames.h */,
 				D01E241C1A205A1500F4C04D /* CSSLength.c */,
 				D01E241D1A205A1500F4C04D /* CSSLength.h */,
 				D01E241E1A205A1500F4C04D /* CSSParser.c */,
@@ -836,13 +834,13 @@
 				D01E24401A205A1500F4C04D /* DFCharacterSet.c */,
 				D01E24411A205A1500F4C04D /* DFCharacterSet.h */,
 				D01E24421A205A1500F4C04D /* DFError.c */,
-				D01E24431A205A1500F4C04D /* DFError.h */,
+				D0B50BAD1A373C080015076A /* DFError.h */,
 				D01E24441A205A1500F4C04D /* DFFilesystem.c */,
 				D01E24451A205A1500F4C04D /* DFFilesystem.h */,
 				D01E24461A205A1500F4C04D /* DFHashTable.c */,
 				D01E24471A205A1500F4C04D /* DFHashTable.h */,
 				D07811781A35801200768ACF /* DFStorage.c */,
-				D07811791A35801200768ACF /* DFStorage.h */,
+				D0B50BAE1A373C080015076A /* DFStorage.h */,
 				D01E244A1A205A1500F4C04D /* DFString.c */,
 				D01E244B1A205A1500F4C04D /* DFString.h */,
 				D01E244C1A205A1500F4C04D /* DFZipFile.c */,
@@ -875,7 +873,7 @@
 				D01E24591A205A1500F4C04D /* DFNameMap.h */,
 				D01E245A1A205A1500F4C04D /* DFXML.c */,
 				D01E245B1A205A1500F4C04D /* DFXML.h */,
-				D01E245C1A205A1500F4C04D /* DFXMLForward.h */,
+				D0B50BAA1A373BE50015076A /* DFXMLForward.h */,
 			);
 			name = xml;
 			path = core/src/xml;
@@ -1095,6 +1093,8 @@
 			children = (
 				D0ADB2F21A2054C6003D645D /* formatting */,
 				D0ADB2FD1A2054C6003D645D /* lenses */,
+				D0A278A91A373C8D00CE7C2E /* CSSClassNames.c */,
+				D0A278AA1A373C8D00CE7C2E /* CSSClassNames.h */,
 				D0ADB3121A2054C6003D645D /* Word.c */,
 				D0ADB3131A2054C6003D645D /* Word.h */,
 				D0ADB3141A2054C6003D645D /* WordCaption.c */,
@@ -1218,6 +1218,7 @@
 				D01E24BD1A205A1500F4C04D /* DFFilesystem.h in Headers */,
 				D0ADB3501A2054C6003D645D /* WordBookmark.h in Headers */,
 				D0ADB3901A2054C6003D645D /* WordObjects.h in Headers */,
+				D0A278AC1A373C8D00CE7C2E /* CSSClassNames.h in Headers */,
 				D01E24A11A205A1500F4C04D /* DFTidyWrapper.h in Headers */,
 				D01E24C11A205A1500F4C04D /* DFHashTable.h in Headers */,
 				D0A787681A210EA900723FE8 /* lexer.h in Headers */,
@@ -1225,7 +1226,6 @@
 				D0A787741A210EA900723FE8 /* parser.h in Headers */,
 				D01E24C91A205A1500F4C04D /* DFString.h in Headers */,
 				D0A787901A210EA900723FE8 /* version.h in Headers */,
-				D01E24E71A205A1500F4C04D /* DFXMLForward.h in Headers */,
 				D0ADB38C1A2054C6003D645D /* WordNumbering.h in Headers */,
 				D01E24891A205A1500F4C04D /* CSSSyntax.h in Headers */,
 				D01E24E11A205A1500F4C04D /* DFNameMap.h in Headers */,
@@ -1246,12 +1246,11 @@
 				D0A787341A210EA900723FE8 /* access.h in Headers */,
 				D0ADB3801A2054C6003D645D /* WordGC.h in Headers */,
 				D0ADB3741A2054C6003D645D /* Word.h in Headers */,
-				D01E246D1A205A1500F4C04D /* CSSClassNames.h in Headers */,
 				D01E24791A205A1500F4C04D /* CSSProperties.h in Headers */,
 				D01E24751A205A1500F4C04D /* CSSParser.h in Headers */,
 				D0165ADE1A206A4D000F1267 /* DFPlatform.h in Headers */,
-				D078117C1A35801200768ACF /* DFStorage.h in Headers */,
 				D01E24D91A205A1500F4C04D /* DFDOM.h in Headers */,
+				D0B50BB11A373C080015076A /* DFStorage.h in Headers */,
 				D0ADB3641A2054C6003D645D /* WordLenses.h in Headers */,
 				D0A786941A210EA900723FE8 /* zip.h in Headers */,
 				D01E24A51A205A1500F4C04D /* DFAllocator.h in Headers */,
@@ -1293,8 +1292,8 @@
 				D01E24911A205A1500F4C04D /* DFHTML.h in Headers */,
 				D01E24CD1A205A1500F4C04D /* DFZipFile.h in Headers */,
 				D0BC41611984106300882CD1 /* DFCommon.h in Headers */,
-				D01E24B91A205A1500F4C04D /* DFError.h in Headers */,
 				D0A7873C1A210EA900723FE8 /* attrdict.h in Headers */,
+				D0B50BAB1A373BE50015076A /* DFXMLForward.h in Headers */,
 				D01E24D11A205A1500F4C04D /* DFXMLNames.h in Headers */,
 				D01E24711A205A1500F4C04D /* CSSLength.h in Headers */,
 				D0A7876E1A210EA900723FE8 /* mappedio.h in Headers */,
@@ -1309,6 +1308,7 @@
 				D0A7875A1A210EA900723FE8 /* forward.h in Headers */,
 				D0A7878A1A210EA900723FE8 /* tmbstr.h in Headers */,
 				D0A787841A210EA900723FE8 /* tidy-int.h in Headers */,
+				D0B50BAF1A373C080015076A /* DFError.h in Headers */,
 				D0ADB35E1A2054C6003D645D /* WordField.h in Headers */,
 				D01E24D51A205A1500F4C04D /* DFXMLNamespaces.h in Headers */,
 				D0ADB3301A2054C6003D645D /* OOXMLTypedefs.h in Headers */,
@@ -1329,6 +1329,7 @@
 				D0ADB3511A2054C6003D645D /* WordBookmark.h in Headers */,
 				D01E24BE1A205A1500F4C04D /* DFFilesystem.h in Headers */,
 				D0ADB3911A2054C6003D645D /* WordObjects.h in Headers */,
+				D0A278AE1A373C9400CE7C2E /* CSSClassNames.h in Headers */,
 				D01E24A21A205A1500F4C04D /* DFTidyWrapper.h in Headers */,
 				D01E24C21A205A1500F4C04D /* DFHashTable.h in Headers */,
 				D0A787691A210EA900723FE8 /* lexer.h in Headers */,
@@ -1337,7 +1338,6 @@
 				D0ADB38D1A2054C6003D645D /* WordNumbering.h in Headers */,
 				D0A787911A210EA900723FE8 /* version.h in Headers */,
 				D01E24CA1A205A1500F4C04D /* DFString.h in Headers */,
-				D01E24E81A205A1500F4C04D /* DFXMLForward.h in Headers */,
 				D0ADB3391A2054C6003D645D /* WordCommonPr.h in Headers */,
 				D01E248A1A205A1500F4C04D /* CSSSyntax.h in Headers */,
 				D01E24E21A205A1500F4C04D /* DFNameMap.h in Headers */,
@@ -1357,12 +1357,11 @@
 				D0A787351A210EA900723FE8 /* access.h in Headers */,
 				D0ADB3811A2054C6003D645D /* WordGC.h in Headers */,
 				D0ADB3751A2054C6003D645D /* Word.h in Headers */,
-				D01E246E1A205A1500F4C04D /* CSSClassNames.h in Headers */,
 				D01E247A1A205A1500F4C04D /* CSSProperties.h in Headers */,
 				D0165AE71A206A7A000F1267 /* DFPlatform.h in Headers */,
 				D01E24761A205A1500F4C04D /* CSSParser.h in Headers */,
-				D078117D1A35801200768ACF /* DFStorage.h in Headers */,
 				D01E24DA1A205A1500F4C04D /* DFDOM.h in Headers */,
+				D0B50BB21A373C080015076A /* DFStorage.h in Headers */,
 				D0A786951A210EA900723FE8 /* zip.h in Headers */,
 				D04459421A20636F00A2E37E /* ODFManifest.h in Headers */,
 				D0A7875F1A210EA900723FE8 /* gdoc.h in Headers */,
@@ -1404,8 +1403,8 @@
 				D01E24921A205A1500F4C04D /* DFHTML.h in Headers */,
 				D0BC41621984106400882CD1 /* DFCommon.h in Headers */,
 				D01E24CE1A205A1500F4C04D /* DFZipFile.h in Headers */,
-				D01E24BA1A205A1500F4C04D /* DFError.h in Headers */,
 				D0A7873D1A210EA900723FE8 /* attrdict.h in Headers */,
+				D0B50BAC1A373BE70015076A /* DFXMLForward.h in Headers */,
 				D01E24D21A205A1500F4C04D /* DFXMLNames.h in Headers */,
 				D01E24721A205A1500F4C04D /* CSSLength.h in Headers */,
 				D0A7876F1A210EA900723FE8 /* mappedio.h in Headers */,
@@ -1420,6 +1419,7 @@
 				D0A7875B1A210EA900723FE8 /* forward.h in Headers */,
 				D0A7878B1A210EA900723FE8 /* tmbstr.h in Headers */,
 				D0A787851A210EA900723FE8 /* tidy-int.h in Headers */,
+				D0B50BB01A373C080015076A /* DFError.h in Headers */,
 				D01E24AA1A205A1500F4C04D /* DFArray.h in Headers */,
 				D01E24D61A205A1500F4C04D /* DFXMLNamespaces.h in Headers */,
 				D0ADB3311A2054C6003D645D /* OOXMLTypedefs.h in Headers */,
@@ -1593,6 +1593,7 @@
 				D01E24771A205A1500F4C04D /* CSSProperties.c in Sources */,
 				D04459371A20635B00A2E37E /* ODF.c in Sources */,
 				D0A7877E1A210EA900723FE8 /* tagask.c in Sources */,
+				D0A278AB1A373C8D00CE7C2E /* CSSClassNames.c in Sources */,
 				D0ADB38A1A2054C6003D645D /* WordNumbering.c in Sources */,
 				D0ADB3621A2054C6003D645D /* WordLenses.c in Sources */,
 				D01E24CB1A205A1500F4C04D /* DFZipFile.c in Sources */,
@@ -1607,7 +1608,6 @@
 				D0ADB34E1A2054C6003D645D /* WordBookmark.c in Sources */,
 				D0A787881A210EA900723FE8 /* tmbstr.c in Sources */,
 				D044593B1A20635B00A2E37E /* ODFPackage.c in Sources */,
-				D01E246B1A205A1500F4C04D /* CSSClassNames.c in Sources */,
 				D0ADB37A1A2054C6003D645D /* WordConverter.c in Sources */,
 				D0A787661A210EA900723FE8 /* lexer.c in Sources */,
 				D0ADB39A1A2054C6003D645D /* WordSettings.c in Sources */,
@@ -1712,6 +1712,7 @@
 				D01E24781A205A1500F4C04D /* CSSProperties.c in Sources */,
 				D0ADB38B1A2054C6003D645D /* WordNumbering.c in Sources */,
 				D0A7877F1A210EA900723FE8 /* tagask.c in Sources */,
+				D0A278AD1A373C9100CE7C2E /* CSSClassNames.c in Sources */,
 				D044593F1A20636F00A2E37E /* ODF.c in Sources */,
 				D0ADB3631A2054C6003D645D /* WordLenses.c in Sources */,
 				D01E24CC1A205A1500F4C04D /* DFZipFile.c in Sources */,
@@ -1725,7 +1726,6 @@
 				D0ADB3611A2054C6003D645D /* WordHyperlink.c in Sources */,
 				D04459431A20636F00A2E37E /* ODFPackage.c in Sources */,
 				D0A787891A210EA900723FE8 /* tmbstr.c in Sources */,
-				D01E246C1A205A1500F4C04D /* CSSClassNames.c in Sources */,
 				D0ADB34F1A2054C6003D645D /* WordBookmark.c in Sources */,
 				D0ADB37B1A2054C6003D645D /* WordConverter.c in Sources */,
 				D0A787671A210EA900723FE8 /* lexer.c in Sources */,

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/368597e7/DocFormats/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/CMakeLists.txt b/DocFormats/CMakeLists.txt
index 7d0dac0..5141170 100644
--- a/DocFormats/CMakeLists.txt
+++ b/DocFormats/CMakeLists.txt
@@ -63,8 +63,6 @@ set(GroupPlatform
 set(GroupCoreCSS
     core/src/css/CSS.c
     core/src/css/CSS.h
-    core/src/css/CSSClassNames.c
-    core/src/css/CSSClassNames.h
     core/src/css/CSSLength.c
     core/src/css/CSSLength.h
     core/src/css/CSSParser.c
@@ -150,6 +148,8 @@ set(GroupOOXMLCommon
     filters/ooxml/src/common/OPC.h)
 
 set(GroupOOXMLWord
+    filters/ooxml/src/word/CSSClassNames.c
+    filters/ooxml/src/word/CSSClassNames.h
     filters/ooxml/src/word/Word.c
     filters/ooxml/src/word/Word.h
     filters/ooxml/src/word/WordCaption.c

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/368597e7/DocFormats/core/src/css/CSSClassNames.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/css/CSSClassNames.c b/DocFormats/core/src/css/CSSClassNames.c
deleted file mode 100644
index d33f214..0000000
--- a/DocFormats/core/src/css/CSSClassNames.c
+++ /dev/null
@@ -1,405 +0,0 @@
-// Copyright 2012-2014 UX Productivity Pty Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "CSSClassNames.h"
-#include "CSS.h"
-#include "CSSProperties.h"
-#include "CSSStyle.h"
-#include "CSSSheet.h"
-#include "DFDOM.h"
-#include "DFXML.h"
-#include "DFNameMap.h"
-#include "DFString.h"
-#include "DFHashTable.h"
-#include "DFHTML.h"
-#include "WordStyles.h"
-#include "Word.h"
-#include "DFCommon.h"
-#include <stdlib.h>
-#include <string.h>
-
-static const char *classPrefixForElementName(const char *elementName);
-
-static void ensureStylesReferencedFromNode(DFNode *node, CSSSheet *styleSheet)
-{
-    switch (node->tag) {
-        case HTML_H1:
-        case HTML_H2:
-        case HTML_H3:
-        case HTML_H4:
-        case HTML_H5:
-        case HTML_H6:
-        case HTML_P:
-        case HTML_FIGURE: {
-            char *selector = CSSMakeNodeSelector(node);
-            CSSSheetLookupSelector(styleSheet,selector,1,0);
-            free(selector);
-            break;
-        }
-        case HTML_A: {
-            if (HTML_nodeIsHyperlink(node)) {
-                CSSStyle *style = CSSSheetLookupElement(styleSheet,"span","Hyperlink",0,0);
-                if (style == NULL) {
-                    style = CSSSheetLookupElement(styleSheet,"span","Hyperlink",1,0);
-                    CSSPut(CSSStyleRule(style),"color","#0000FF");
-                    CSSSetUnderline(CSSStyleRule(style),1);
-
-                    CSSStyle *parent = CSSSheetDefaultStyleForFamily(styleSheet,StyleFamilyCharacter);
-                    if (parent != NULL)
-                        CSSStyleSetParent(style,parent->selector);
-                }
-            }
-            break;
-        }
-        case HTML_TABLE: {
-            const char *className = DFGetAttribute(node,HTML_CLASS);
-            if (className == NULL) {
-                CSSStyle *dflt = CSSSheetDefaultStyleForFamily(styleSheet,StyleFamilyTable);
-                int changed = 0;
-                CSSStyle *grid = WordSetupTableGridStyle(styleSheet,&changed);
-                DFSetAttribute(node,HTML_CLASS,grid->className);
-
-                // Copy over cell padding rules. These are not automatically inherited in Word, and must be
-                // explicitly duplicated for each descendant of the TableNormal style.
-
-                // Under normal circumstances, when the user has added a table in the editor, the TableGrid
-                // style will already be defined, with the appropriate padding rules set in the document's
-                // stylesheet, and StyleSheet.removeRedundantProperties will make sure that each table style
-                // keeps the padding properties. However if we are creating a HTML file that was not
-                // oringally created with the intention of being converted to a word document, the TableGrid
-                // style will not exist, and must be created. In this case (i.e. where changed is true) we
-                // have to explicitly copy these properties over.
-
-                if (changed) {
-                    CSSPut(CSSStyleCell(grid),"padding-left",CSSGet(CSSStyleCell(dflt),"padding-left"));
-                    CSSPut(CSSStyleCell(grid),"padding-right",CSSGet(CSSStyleCell(dflt),"padding-right"));
-                    CSSPut(CSSStyleCell(grid),"padding-top",CSSGet(CSSStyleCell(dflt),"padding-top"));
-                    CSSPut(CSSStyleCell(grid),"padding-bottom",CSSGet(CSSStyleCell(dflt),"padding-bottom"));
-                }
-            }
-            break;
-        }
-    }
-    for (DFNode *child = node->first; child != NULL; child = child->next)
-        ensureStylesReferencedFromNode(child,styleSheet);
-}
-
-void CSSEnsureReferencedStylesPresent(DFDocument *htmlDoc, CSSSheet *styleSheet)
-{
-    CSSSheetLookupSelector(styleSheet,"p",1,0);
-    ensureStylesReferencedFromNode(htmlDoc->root,styleSheet);
-}
-
-static void addHTMLDefaults(CSSStyle *style, CSSStyle *parent)
-{
-    if (style->headingLevel > 0) {
-        const char *fontWeight = NULL;
-        const char *fontSize = NULL;
-
-        switch (style->tag) {
-            case HTML_H1:
-                fontWeight = "bold";
-                fontSize = "24pt";
-                break;
-            case HTML_H2:
-                fontWeight = "bold";
-                fontSize = "18pt";
-                break;
-            case HTML_H3:
-                fontWeight = "bold";
-                fontSize = "14pt";
-                break;
-            case HTML_H4:
-                fontWeight = "bold";
-                fontSize = "12pt";
-                break;
-            case HTML_H5:
-                fontWeight = "bold";
-                fontSize = "10pt";
-                break;
-            case HTML_H6:
-                fontWeight = "bold";
-                fontSize = "8pt";
-                break;
-        }
-
-        CSSProperties *properties = CSSStyleRule(style);
-        if ((CSSGet(properties,"font-weight") == NULL) && ((parent == NULL) || (CSSGet(CSSStyleRule(parent),"font-weight") == NULL)))
-            CSSPut(properties,"font-weight",fontWeight);
-        if ((CSSGet(properties,"font-size") == NULL) && ((parent == NULL) || (CSSGet(CSSStyleRule(parent),"font-size") == NULL)))
-            CSSPut(properties,"font-size",fontSize);
-        // FIXME: This likely differs between languages
-        // FIXME: Not covered by tests
-        char *styleNext = CSSStyleCopyNext(style);
-        char *parentNext = (parent != NULL) ? CSSStyleCopyNext(parent) : NULL;
-        if ((styleNext == NULL) && ((parent == NULL) || (parentNext == NULL)))
-            CSSStyleSetNext(style,"p.Normal");
-        free(styleNext);
-        free(parentNext);
-    }
-}
-
-void CSSSetHTMLDefaults(CSSSheet *styleSheet)
-{
-    // For any heading elements that have an unnamed style declaration, set the default HTML properties on that.
-    // All named style declarations inherit from these.
-
-    // For any heading elements that have only named style declarations, set the default HTML properties on each
-    // of them individually.
-
-    for (int i = 1; i <= 6; i++) {
-        char *elementName = DFFormatString("h%d",i);
-        CSSStyle *style = CSSSheetLookupElement(styleSheet,elementName,NULL,0,0);
-        if (style != NULL)
-            addHTMLDefaults(style,NULL);
-        free(elementName);
-    }
-
-    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
-    for (int i = 0; allSelectors[i]; i++) {
-        const char *selector = allSelectors[i];
-
-        if (CSSSelectorIsHeading(selector) && (CSSSelectorHasClassName(selector))) {
-            char *elementName = CSSSelectorCopyElementName(selector);
-
-            CSSStyle *namedStyle = CSSSheetLookupSelector(styleSheet,selector,0,0);
-            CSSStyle *unnamedStyle = CSSSheetLookupSelector(styleSheet,elementName,0,0);
-            CSSStyle *flattened = NULL;
-            CSSStyle *parent = CSSSheetGetStyleParent(styleSheet,namedStyle);
-            if (parent != NULL)
-                flattened = CSSSheetFlattenedStyle(styleSheet,parent);
-
-            if (unnamedStyle == NULL)
-                addHTMLDefaults(namedStyle,flattened);
-
-            CSSStyleRelease(flattened);
-            free(elementName);
-        }
-    }
-    free(allSelectors);
-}
-
-static void setMissingDisplayNames(CSSSheet *styleSheet)
-{
-    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
-    for (int i = 0; allSelectors[i]; i++) {
-        CSSStyle *style = CSSSheetLookupSelector(styleSheet,allSelectors[i],0,0);
-        char *className = NULL;
-        char *displayName = CSSStyleCopyDisplayName(style);
-        if ((style->headingLevel > 0) && (displayName == NULL)) {
-            const char *defaultClass = classPrefixForElementName(style->elementName);
-
-            if ((style->className != NULL) && (defaultClass != NULL) && DFStringHasPrefix(style->className,defaultClass))
-                className = DFSubstring(style->className,strlen(defaultClass),strlen(style->className));
-            else
-                className = DFStrDup(style->className);
-
-            if ((className != NULL) && strlen(className) > 0)
-                displayName = DFFormatString("Heading %d (%s)",style->headingLevel,className);
-            else
-                displayName = DFFormatString("heading %d",style->headingLevel);
-            CSSStyleSetDisplayName(style,displayName);
-        }
-        free(displayName);
-        free(className);
-    }
-    free(allSelectors);
-}
-
-static void setParentForHeadings(CSSSheet *styleSheet, DFHashTable *repls)
-{
-    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
-    for (int i = 0; allSelectors[i]; i++) {
-        const char *selector = allSelectors[i];
-        if (!CSSSelectorIsHeading(selector))
-            continue;
-
-        CSSStyle *style = CSSSheetLookupSelector(styleSheet,selector,0,0);
-        const char *defaultClass = classPrefixForElementName(style->elementName);
-        if (defaultClass == NULL)
-            continue;
-
-        CSSStyle *parentStyle = CSSSheetLookupElement(styleSheet,style->elementName,defaultClass,0,0);
-        if ((parentStyle != NULL) && (parentStyle != style))
-            CSSStyleSetParent(style,parentStyle->selector);
-    }
-    free(allSelectors);
-}
-
-static const char *classPrefixForElementName(const char *elementName)
-{
-    if (!strcmp(elementName,"h1"))
-        return "heading_1";
-    else if (!strcmp(elementName,"h2"))
-        return "heading_2";
-    else if (!strcmp(elementName,"h3"))
-        return "heading_3";
-    else if (!strcmp(elementName,"h4"))
-        return "heading_4";
-    else if (!strcmp(elementName,"h5"))
-        return "heading_5";
-    else if (!strcmp(elementName,"h6"))
-        return "heading_6";
-    else
-        return elementName;
-}
-
-static void determineReplacements(CSSSheet *styleSheet, DFHashTable *repls)
-{
-    // char * -> linked list of SelectorList nodes
-    DFHashTable *selectorsByClassName = DFHashTableNew(NULL,NULL);
-
-    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
-    for (int i = 0; allSelectors[i]; i++) {
-        const char *selector = allSelectors[i];
-        char *className = CSSSelectorCopyClassName(selector);
-        if (className == NULL)
-            className = strdup("");;
-
-        SelectorList *item = (SelectorList *)calloc(1,sizeof(SelectorList));
-        item->selector = strdup(selector);
-        item->next = DFHashTableLookup(selectorsByClassName,className);
-        DFHashTableAdd(selectorsByClassName,className,item);
-        free(className);
-    }
-    free(allSelectors);
-
-    const char **allClasses = DFHashTableCopyKeys(selectorsByClassName);
-    for (int i = 0; allClasses[i]; i++) {
-        const char *className = allClasses[i];
-        SelectorList *list = DFHashTableLookup(selectorsByClassName,className);
-        SelectorList *start = list;
-        SelectorList *next;
-        for (; list != NULL; list = next) {
-            next = list->next;
-            const char *oldSelector = list->selector;
-            char *elementName = CSSSelectorCopyElementName(oldSelector);
-            int haveUnnamed = (CSSSheetLookupSelector(styleSheet,elementName,0,0) != NULL);
-            if (((start != NULL) && (start->next != NULL)) || !strcmp(className,"") || haveUnnamed) {
-                if (CSSSelectorIsHeading(oldSelector)) {
-                    const char *prefix = classPrefixForElementName(elementName);
-                    char *newSelector = DFFormatString("%s.%s%s",elementName,prefix,className);
-                    DFHashTableAdd(repls,oldSelector,newSelector);
-                    free(newSelector);
-                }
-            }
-            free(elementName);
-        }
-
-        // Free selector list
-        for (list = start; list != NULL; list = next) {
-            next = list->next;
-            free(list->selector);
-            free(list);
-        }
-    }
-    free(allClasses);
-    DFHashTableRelease(selectorsByClassName);
-
-    // Remove any "double replacements", where the new selector is itself a key in the hash table, e.g.:
-    // h1 -> h1.Heading1 -> h1.Heading1Heading1
-    //
-    // This avoids a problem where a style is renamed twice, but the relevant nodes in the DOM tree are only updated
-    // to refer to the first replacement, not the second, causing an assertion failure in WordParagraphPut, which
-    // expects there to be a style for every selector it encounters during traversal.
-    const char **allOldSelectors = DFHashTableCopyKeys(repls);
-    for (int i = 0; allOldSelectors[i]; i++) {
-        const char *newSelector = DFHashTableLookup(repls,allOldSelectors[i]);
-        if (newSelector != NULL) // may have already been removed
-            DFHashTableRemove(repls,newSelector);
-    }
-    free(allOldSelectors);
-}
-
-static void replaceSelectorsInNode(DFHashTable *repls, DFNode *node)
-{
-    switch (node->tag) {
-        case HTML_H1:
-        case HTML_H2:
-        case HTML_H3:
-        case HTML_H4:
-        case HTML_H5:
-        case HTML_H6: {
-            const char *className = DFGetAttribute(node,HTML_CLASS);
-            char *oldSelector = CSSMakeTagSelector(node->tag,className);
-            const char *newSelector = DFHashTableLookup(repls,oldSelector);
-
-            if (newSelector != NULL) {
-                char *className = CSSSelectorCopyClassName(newSelector);
-                DFSetAttribute(node,HTML_CLASS,className);
-                free(className);
-            }
-
-            free(oldSelector);
-            break;
-        }
-    }
-    for (DFNode *child = node->first; child != NULL; child = child->next)
-        replaceSelectorsInNode(repls,child);
-}
-
-static void replaceSelectorsInSheet(DFHashTable *repls, CSSSheet *styleSheet)
-{
-    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
-    for (int i = 0; allSelectors[i]; i++) {
-        const char *oldSelector = allSelectors[i];
-        const char *newSelector = DFHashTableLookup(repls,oldSelector);
-        if ((newSelector == NULL) || !strcmp(newSelector,oldSelector))
-            continue;
-
-        CSSStyle *style = CSSSheetLookupSelector(styleSheet,oldSelector,0,0);
-        CSSStyle *existing = CSSSheetLookupSelector(styleSheet,newSelector,0,0);
-
-        if (existing != NULL) {
-            CSSSheetRemoveStyle(styleSheet,style);
-        }
-        else {
-            // We must retain a reference to the style here, otherwise it will be deleted when removed from the sheet
-            CSSStyleRetain(style);
-            CSSSheetRemoveStyle(styleSheet,style);
-            CSSStyleSetSelector(style,newSelector);
-            CSSSheetAddStyle(styleSheet,style);
-            CSSStyleRelease(style);
-        }
-    }
-    free(allSelectors);
-
-    // FIXME: Not covered by tests
-    allSelectors = CSSSheetCopySelectors(styleSheet);
-    for (int i = 0; allSelectors[i]; i++) {
-        CSSStyle *style = CSSSheetLookupSelector(styleSheet,allSelectors[i],0,0);
-
-        char *parentSelector = CSSStyleCopyParent(style);
-        if ((parentSelector != NULL) && (DFHashTableLookup(repls,parentSelector) != NULL))
-            CSSStyleSetParent(style,DFHashTableLookup(repls,parentSelector));
-        free(parentSelector);
-
-        char *nextSelector = CSSStyleCopyNext(style);
-        if ((nextSelector != NULL) && (DFHashTableLookup(repls,nextSelector) != NULL))
-            CSSStyleSetNext(style,DFHashTableLookup(repls,nextSelector));
-        free(nextSelector);
-    }
-    free(allSelectors);
-}
-
-void CSSEnsureUnique(CSSSheet *styleSheet, DFDocument *htmlDoc, int creating)
-{
-    DFHashTable *repls = DFHashTableNew((DFCopyFunction)strdup,free);
-    determineReplacements(styleSheet,repls);
-    replaceSelectorsInSheet(repls,styleSheet);
-    replaceSelectorsInNode(repls,htmlDoc->root);
-    setMissingDisplayNames(styleSheet);
-    setParentForHeadings(styleSheet,repls);
-    DFHashTableRelease(repls);
-}

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/368597e7/DocFormats/core/src/css/CSSClassNames.h
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/css/CSSClassNames.h b/DocFormats/core/src/css/CSSClassNames.h
deleted file mode 100644
index 2f29b62..0000000
--- a/DocFormats/core/src/css/CSSClassNames.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2012-2014 UX Productivity Pty Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef DocFormats_CSSClassNames_h
-#define DocFormats_CSSClassNames_h
-
-#include <DocFormats/DFXMLForward.h>
-#include "CSSSheet.h"
-
-void CSSEnsureReferencedStylesPresent(DFDocument *htmlDoc, CSSSheet *styleSheet);
-void CSSSetHTMLDefaults(CSSSheet *styleSheet);
-void CSSEnsureUnique(CSSSheet *styleSheet, DFDocument *htmlDoc, int creating);
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/368597e7/DocFormats/filters/ooxml/src/word/CSSClassNames.c
----------------------------------------------------------------------
diff --git a/DocFormats/filters/ooxml/src/word/CSSClassNames.c b/DocFormats/filters/ooxml/src/word/CSSClassNames.c
new file mode 100644
index 0000000..d33f214
--- /dev/null
+++ b/DocFormats/filters/ooxml/src/word/CSSClassNames.c
@@ -0,0 +1,405 @@
+// Copyright 2012-2014 UX Productivity Pty Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "CSSClassNames.h"
+#include "CSS.h"
+#include "CSSProperties.h"
+#include "CSSStyle.h"
+#include "CSSSheet.h"
+#include "DFDOM.h"
+#include "DFXML.h"
+#include "DFNameMap.h"
+#include "DFString.h"
+#include "DFHashTable.h"
+#include "DFHTML.h"
+#include "WordStyles.h"
+#include "Word.h"
+#include "DFCommon.h"
+#include <stdlib.h>
+#include <string.h>
+
+static const char *classPrefixForElementName(const char *elementName);
+
+static void ensureStylesReferencedFromNode(DFNode *node, CSSSheet *styleSheet)
+{
+    switch (node->tag) {
+        case HTML_H1:
+        case HTML_H2:
+        case HTML_H3:
+        case HTML_H4:
+        case HTML_H5:
+        case HTML_H6:
+        case HTML_P:
+        case HTML_FIGURE: {
+            char *selector = CSSMakeNodeSelector(node);
+            CSSSheetLookupSelector(styleSheet,selector,1,0);
+            free(selector);
+            break;
+        }
+        case HTML_A: {
+            if (HTML_nodeIsHyperlink(node)) {
+                CSSStyle *style = CSSSheetLookupElement(styleSheet,"span","Hyperlink",0,0);
+                if (style == NULL) {
+                    style = CSSSheetLookupElement(styleSheet,"span","Hyperlink",1,0);
+                    CSSPut(CSSStyleRule(style),"color","#0000FF");
+                    CSSSetUnderline(CSSStyleRule(style),1);
+
+                    CSSStyle *parent = CSSSheetDefaultStyleForFamily(styleSheet,StyleFamilyCharacter);
+                    if (parent != NULL)
+                        CSSStyleSetParent(style,parent->selector);
+                }
+            }
+            break;
+        }
+        case HTML_TABLE: {
+            const char *className = DFGetAttribute(node,HTML_CLASS);
+            if (className == NULL) {
+                CSSStyle *dflt = CSSSheetDefaultStyleForFamily(styleSheet,StyleFamilyTable);
+                int changed = 0;
+                CSSStyle *grid = WordSetupTableGridStyle(styleSheet,&changed);
+                DFSetAttribute(node,HTML_CLASS,grid->className);
+
+                // Copy over cell padding rules. These are not automatically inherited in Word, and must be
+                // explicitly duplicated for each descendant of the TableNormal style.
+
+                // Under normal circumstances, when the user has added a table in the editor, the TableGrid
+                // style will already be defined, with the appropriate padding rules set in the document's
+                // stylesheet, and StyleSheet.removeRedundantProperties will make sure that each table style
+                // keeps the padding properties. However if we are creating a HTML file that was not
+                // oringally created with the intention of being converted to a word document, the TableGrid
+                // style will not exist, and must be created. In this case (i.e. where changed is true) we
+                // have to explicitly copy these properties over.
+
+                if (changed) {
+                    CSSPut(CSSStyleCell(grid),"padding-left",CSSGet(CSSStyleCell(dflt),"padding-left"));
+                    CSSPut(CSSStyleCell(grid),"padding-right",CSSGet(CSSStyleCell(dflt),"padding-right"));
+                    CSSPut(CSSStyleCell(grid),"padding-top",CSSGet(CSSStyleCell(dflt),"padding-top"));
+                    CSSPut(CSSStyleCell(grid),"padding-bottom",CSSGet(CSSStyleCell(dflt),"padding-bottom"));
+                }
+            }
+            break;
+        }
+    }
+    for (DFNode *child = node->first; child != NULL; child = child->next)
+        ensureStylesReferencedFromNode(child,styleSheet);
+}
+
+void CSSEnsureReferencedStylesPresent(DFDocument *htmlDoc, CSSSheet *styleSheet)
+{
+    CSSSheetLookupSelector(styleSheet,"p",1,0);
+    ensureStylesReferencedFromNode(htmlDoc->root,styleSheet);
+}
+
+static void addHTMLDefaults(CSSStyle *style, CSSStyle *parent)
+{
+    if (style->headingLevel > 0) {
+        const char *fontWeight = NULL;
+        const char *fontSize = NULL;
+
+        switch (style->tag) {
+            case HTML_H1:
+                fontWeight = "bold";
+                fontSize = "24pt";
+                break;
+            case HTML_H2:
+                fontWeight = "bold";
+                fontSize = "18pt";
+                break;
+            case HTML_H3:
+                fontWeight = "bold";
+                fontSize = "14pt";
+                break;
+            case HTML_H4:
+                fontWeight = "bold";
+                fontSize = "12pt";
+                break;
+            case HTML_H5:
+                fontWeight = "bold";
+                fontSize = "10pt";
+                break;
+            case HTML_H6:
+                fontWeight = "bold";
+                fontSize = "8pt";
+                break;
+        }
+
+        CSSProperties *properties = CSSStyleRule(style);
+        if ((CSSGet(properties,"font-weight") == NULL) && ((parent == NULL) || (CSSGet(CSSStyleRule(parent),"font-weight") == NULL)))
+            CSSPut(properties,"font-weight",fontWeight);
+        if ((CSSGet(properties,"font-size") == NULL) && ((parent == NULL) || (CSSGet(CSSStyleRule(parent),"font-size") == NULL)))
+            CSSPut(properties,"font-size",fontSize);
+        // FIXME: This likely differs between languages
+        // FIXME: Not covered by tests
+        char *styleNext = CSSStyleCopyNext(style);
+        char *parentNext = (parent != NULL) ? CSSStyleCopyNext(parent) : NULL;
+        if ((styleNext == NULL) && ((parent == NULL) || (parentNext == NULL)))
+            CSSStyleSetNext(style,"p.Normal");
+        free(styleNext);
+        free(parentNext);
+    }
+}
+
+void CSSSetHTMLDefaults(CSSSheet *styleSheet)
+{
+    // For any heading elements that have an unnamed style declaration, set the default HTML properties on that.
+    // All named style declarations inherit from these.
+
+    // For any heading elements that have only named style declarations, set the default HTML properties on each
+    // of them individually.
+
+    for (int i = 1; i <= 6; i++) {
+        char *elementName = DFFormatString("h%d",i);
+        CSSStyle *style = CSSSheetLookupElement(styleSheet,elementName,NULL,0,0);
+        if (style != NULL)
+            addHTMLDefaults(style,NULL);
+        free(elementName);
+    }
+
+    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
+    for (int i = 0; allSelectors[i]; i++) {
+        const char *selector = allSelectors[i];
+
+        if (CSSSelectorIsHeading(selector) && (CSSSelectorHasClassName(selector))) {
+            char *elementName = CSSSelectorCopyElementName(selector);
+
+            CSSStyle *namedStyle = CSSSheetLookupSelector(styleSheet,selector,0,0);
+            CSSStyle *unnamedStyle = CSSSheetLookupSelector(styleSheet,elementName,0,0);
+            CSSStyle *flattened = NULL;
+            CSSStyle *parent = CSSSheetGetStyleParent(styleSheet,namedStyle);
+            if (parent != NULL)
+                flattened = CSSSheetFlattenedStyle(styleSheet,parent);
+
+            if (unnamedStyle == NULL)
+                addHTMLDefaults(namedStyle,flattened);
+
+            CSSStyleRelease(flattened);
+            free(elementName);
+        }
+    }
+    free(allSelectors);
+}
+
+static void setMissingDisplayNames(CSSSheet *styleSheet)
+{
+    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
+    for (int i = 0; allSelectors[i]; i++) {
+        CSSStyle *style = CSSSheetLookupSelector(styleSheet,allSelectors[i],0,0);
+        char *className = NULL;
+        char *displayName = CSSStyleCopyDisplayName(style);
+        if ((style->headingLevel > 0) && (displayName == NULL)) {
+            const char *defaultClass = classPrefixForElementName(style->elementName);
+
+            if ((style->className != NULL) && (defaultClass != NULL) && DFStringHasPrefix(style->className,defaultClass))
+                className = DFSubstring(style->className,strlen(defaultClass),strlen(style->className));
+            else
+                className = DFStrDup(style->className);
+
+            if ((className != NULL) && strlen(className) > 0)
+                displayName = DFFormatString("Heading %d (%s)",style->headingLevel,className);
+            else
+                displayName = DFFormatString("heading %d",style->headingLevel);
+            CSSStyleSetDisplayName(style,displayName);
+        }
+        free(displayName);
+        free(className);
+    }
+    free(allSelectors);
+}
+
+static void setParentForHeadings(CSSSheet *styleSheet, DFHashTable *repls)
+{
+    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
+    for (int i = 0; allSelectors[i]; i++) {
+        const char *selector = allSelectors[i];
+        if (!CSSSelectorIsHeading(selector))
+            continue;
+
+        CSSStyle *style = CSSSheetLookupSelector(styleSheet,selector,0,0);
+        const char *defaultClass = classPrefixForElementName(style->elementName);
+        if (defaultClass == NULL)
+            continue;
+
+        CSSStyle *parentStyle = CSSSheetLookupElement(styleSheet,style->elementName,defaultClass,0,0);
+        if ((parentStyle != NULL) && (parentStyle != style))
+            CSSStyleSetParent(style,parentStyle->selector);
+    }
+    free(allSelectors);
+}
+
+static const char *classPrefixForElementName(const char *elementName)
+{
+    if (!strcmp(elementName,"h1"))
+        return "heading_1";
+    else if (!strcmp(elementName,"h2"))
+        return "heading_2";
+    else if (!strcmp(elementName,"h3"))
+        return "heading_3";
+    else if (!strcmp(elementName,"h4"))
+        return "heading_4";
+    else if (!strcmp(elementName,"h5"))
+        return "heading_5";
+    else if (!strcmp(elementName,"h6"))
+        return "heading_6";
+    else
+        return elementName;
+}
+
+static void determineReplacements(CSSSheet *styleSheet, DFHashTable *repls)
+{
+    // char * -> linked list of SelectorList nodes
+    DFHashTable *selectorsByClassName = DFHashTableNew(NULL,NULL);
+
+    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
+    for (int i = 0; allSelectors[i]; i++) {
+        const char *selector = allSelectors[i];
+        char *className = CSSSelectorCopyClassName(selector);
+        if (className == NULL)
+            className = strdup("");;
+
+        SelectorList *item = (SelectorList *)calloc(1,sizeof(SelectorList));
+        item->selector = strdup(selector);
+        item->next = DFHashTableLookup(selectorsByClassName,className);
+        DFHashTableAdd(selectorsByClassName,className,item);
+        free(className);
+    }
+    free(allSelectors);
+
+    const char **allClasses = DFHashTableCopyKeys(selectorsByClassName);
+    for (int i = 0; allClasses[i]; i++) {
+        const char *className = allClasses[i];
+        SelectorList *list = DFHashTableLookup(selectorsByClassName,className);
+        SelectorList *start = list;
+        SelectorList *next;
+        for (; list != NULL; list = next) {
+            next = list->next;
+            const char *oldSelector = list->selector;
+            char *elementName = CSSSelectorCopyElementName(oldSelector);
+            int haveUnnamed = (CSSSheetLookupSelector(styleSheet,elementName,0,0) != NULL);
+            if (((start != NULL) && (start->next != NULL)) || !strcmp(className,"") || haveUnnamed) {
+                if (CSSSelectorIsHeading(oldSelector)) {
+                    const char *prefix = classPrefixForElementName(elementName);
+                    char *newSelector = DFFormatString("%s.%s%s",elementName,prefix,className);
+                    DFHashTableAdd(repls,oldSelector,newSelector);
+                    free(newSelector);
+                }
+            }
+            free(elementName);
+        }
+
+        // Free selector list
+        for (list = start; list != NULL; list = next) {
+            next = list->next;
+            free(list->selector);
+            free(list);
+        }
+    }
+    free(allClasses);
+    DFHashTableRelease(selectorsByClassName);
+
+    // Remove any "double replacements", where the new selector is itself a key in the hash table, e.g.:
+    // h1 -> h1.Heading1 -> h1.Heading1Heading1
+    //
+    // This avoids a problem where a style is renamed twice, but the relevant nodes in the DOM tree are only updated
+    // to refer to the first replacement, not the second, causing an assertion failure in WordParagraphPut, which
+    // expects there to be a style for every selector it encounters during traversal.
+    const char **allOldSelectors = DFHashTableCopyKeys(repls);
+    for (int i = 0; allOldSelectors[i]; i++) {
+        const char *newSelector = DFHashTableLookup(repls,allOldSelectors[i]);
+        if (newSelector != NULL) // may have already been removed
+            DFHashTableRemove(repls,newSelector);
+    }
+    free(allOldSelectors);
+}
+
+static void replaceSelectorsInNode(DFHashTable *repls, DFNode *node)
+{
+    switch (node->tag) {
+        case HTML_H1:
+        case HTML_H2:
+        case HTML_H3:
+        case HTML_H4:
+        case HTML_H5:
+        case HTML_H6: {
+            const char *className = DFGetAttribute(node,HTML_CLASS);
+            char *oldSelector = CSSMakeTagSelector(node->tag,className);
+            const char *newSelector = DFHashTableLookup(repls,oldSelector);
+
+            if (newSelector != NULL) {
+                char *className = CSSSelectorCopyClassName(newSelector);
+                DFSetAttribute(node,HTML_CLASS,className);
+                free(className);
+            }
+
+            free(oldSelector);
+            break;
+        }
+    }
+    for (DFNode *child = node->first; child != NULL; child = child->next)
+        replaceSelectorsInNode(repls,child);
+}
+
+static void replaceSelectorsInSheet(DFHashTable *repls, CSSSheet *styleSheet)
+{
+    const char **allSelectors = CSSSheetCopySelectors(styleSheet);
+    for (int i = 0; allSelectors[i]; i++) {
+        const char *oldSelector = allSelectors[i];
+        const char *newSelector = DFHashTableLookup(repls,oldSelector);
+        if ((newSelector == NULL) || !strcmp(newSelector,oldSelector))
+            continue;
+
+        CSSStyle *style = CSSSheetLookupSelector(styleSheet,oldSelector,0,0);
+        CSSStyle *existing = CSSSheetLookupSelector(styleSheet,newSelector,0,0);
+
+        if (existing != NULL) {
+            CSSSheetRemoveStyle(styleSheet,style);
+        }
+        else {
+            // We must retain a reference to the style here, otherwise it will be deleted when removed from the sheet
+            CSSStyleRetain(style);
+            CSSSheetRemoveStyle(styleSheet,style);
+            CSSStyleSetSelector(style,newSelector);
+            CSSSheetAddStyle(styleSheet,style);
+            CSSStyleRelease(style);
+        }
+    }
+    free(allSelectors);
+
+    // FIXME: Not covered by tests
+    allSelectors = CSSSheetCopySelectors(styleSheet);
+    for (int i = 0; allSelectors[i]; i++) {
+        CSSStyle *style = CSSSheetLookupSelector(styleSheet,allSelectors[i],0,0);
+
+        char *parentSelector = CSSStyleCopyParent(style);
+        if ((parentSelector != NULL) && (DFHashTableLookup(repls,parentSelector) != NULL))
+            CSSStyleSetParent(style,DFHashTableLookup(repls,parentSelector));
+        free(parentSelector);
+
+        char *nextSelector = CSSStyleCopyNext(style);
+        if ((nextSelector != NULL) && (DFHashTableLookup(repls,nextSelector) != NULL))
+            CSSStyleSetNext(style,DFHashTableLookup(repls,nextSelector));
+        free(nextSelector);
+    }
+    free(allSelectors);
+}
+
+void CSSEnsureUnique(CSSSheet *styleSheet, DFDocument *htmlDoc, int creating)
+{
+    DFHashTable *repls = DFHashTableNew((DFCopyFunction)strdup,free);
+    determineReplacements(styleSheet,repls);
+    replaceSelectorsInSheet(repls,styleSheet);
+    replaceSelectorsInNode(repls,htmlDoc->root);
+    setMissingDisplayNames(styleSheet);
+    setParentForHeadings(styleSheet,repls);
+    DFHashTableRelease(repls);
+}

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/368597e7/DocFormats/filters/ooxml/src/word/CSSClassNames.h
----------------------------------------------------------------------
diff --git a/DocFormats/filters/ooxml/src/word/CSSClassNames.h b/DocFormats/filters/ooxml/src/word/CSSClassNames.h
new file mode 100644
index 0000000..2f29b62
--- /dev/null
+++ b/DocFormats/filters/ooxml/src/word/CSSClassNames.h
@@ -0,0 +1,25 @@
+// Copyright 2012-2014 UX Productivity Pty Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef DocFormats_CSSClassNames_h
+#define DocFormats_CSSClassNames_h
+
+#include <DocFormats/DFXMLForward.h>
+#include "CSSSheet.h"
+
+void CSSEnsureReferencedStylesPresent(DFDocument *htmlDoc, CSSSheet *styleSheet);
+void CSSSetHTMLDefaults(CSSSheet *styleSheet);
+void CSSEnsureUnique(CSSSheet *styleSheet, DFDocument *htmlDoc, int creating);
+
+#endif


Mime
View raw message