Skip to content

Commit aa48a1c

Browse files
committed
crengine changes
1 parent 9870c9a commit aa48a1c

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

crengine/src/lvopc.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,24 @@ void OpcPackage::readContentTypes()
136136
for(int i = 0; i < root->getChildCount(); i++) {
137137
ldomNode * typeNode = root->getChildNode(i);
138138

139-
if(typeNode->getNodeName() == cs16("Override")) //Don't care about Extensions
140-
m_contentTypes.set( typeNode->getAttributeValue(L"ContentType"),
141-
typeNode->getAttributeValue(L"PartName") );
139+
//plotn - add TextMaker file format
140+
//if(typeNode->getNodeName() == cs16("Override")) //Don't care about Extensions
141+
// m_contentTypes.set( typeNode->getAttributeValue(L"ContentType"),
142+
// typeNode->getAttributeValue(L"PartName") );
143+
144+
if(typeNode->getNodeName() == cs16("Override")) { //Don't care about Extensions
145+
lString16 contentType = typeNode->getAttributeValue(L"ContentType");
146+
lString16 partName = typeNode->getAttributeValue(L"PartName");
147+
if (
148+
(partName == L"/word/document.xml")&&
149+
(contentType == L"application/textmaker.wordprocessingml.document.main+xml")
150+
) {
151+
m_contentTypes.set(L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",
152+
typeNode->getAttributeValue(L"PartName"));
153+
} else
154+
m_contentTypes.set(typeNode->getAttributeValue(L"ContentType"),
155+
typeNode->getAttributeValue(L"PartName"));
156+
}
142157
}
143158
}
144159
delete doc;

crengine/src/private/lvfontcache.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,22 @@ class LVFontCache {
103103
list.sort();
104104
}
105105

106+
//plotn
107+
virtual void getFontFaceAndFileNameList(lString16Collection &list)
108+
{
109+
list.clear();
110+
for ( int i=0; i<_registered_list.length(); i++ ) {
111+
if (_registered_list[i]->getDef()->getDocumentId() == -1) {
112+
lString16 name = Utf8ToUnicode( _registered_list[i]->getDef()->getTypeFace() );
113+
lString16 fileName = Utf8ToUnicode(_registered_list[i]->getDef()->getName());
114+
if (!list.contains(name + "~" + fileName))
115+
list.add(name + "~" + fileName);
116+
}
117+
}
118+
list.sort();
119+
}
120+
//\plotn
121+
106122
virtual void clearFallbackFonts() {
107123
for (int i = 0; i < _registered_list.length(); i++) {
108124
_registered_list[i]->getFont()->setFallbackFont(LVFontRef());

crengine/src/private/lvfreetypefontman.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,11 @@ void LVFreeTypeFontManager::getFontFileNameList(lString16Collection &list) {
446446
_cache.getFontFileNameList(list);
447447
}
448448

449+
void LVFreeTypeFontManager::getFontFaceAndFileNameList(lString16Collection &list) {
450+
FONT_MAN_GUARD
451+
_cache.getFontFaceAndFileNameList(list);
452+
}
453+
449454
bool LVFreeTypeFontManager::setalias(lString8 alias, lString8 facename, int id, bool italic, bool bold) {
450455
FONT_MAN_GUARD
451456
lString8 fontname = lString8("\0");

0 commit comments

Comments
 (0)