summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorALONSO Laurent <laurent.alonso@inria.fr>2021-09-15 11:12:42 +0200
committerALONSO Laurent <laurent.alonso@inria.fr>2021-09-15 11:12:42 +0200
commit04029fe202d4dcccdbc78960f35cdbf5e4da3364 (patch)
tree3286dabd7ae3b8cb505243d1d91483b491973cd2
parentd1286eede8ff16eab5860c2e11c24ea1d902aa60 (diff)
Try to retrieve more background colors...
Change-Id: I3477e35cbcb8023ad7e90b533c497c888dbce607
-rw-r--r--src/lib/IWAParser.cpp2
-rw-r--r--src/lib/libetonyek_utils.cpp7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/IWAParser.cpp b/src/lib/IWAParser.cpp
index 6de5fe7..d4f914a 100644
--- a/src/lib/IWAParser.cpp
+++ b/src/lib/IWAParser.cpp
@@ -483,6 +483,8 @@ bool IWAParser::readFill(const IWAMessage &msg, IWORKFill &fill)
}
}
bitmap.m_fillColor = readColor(get(msg.message(3)), 3);
+ if (!bitmap.m_fillColor) // a least in new KeyNote files, the field 9 can also store a color
+ bitmap.m_fillColor = readColor(get(msg.message(3)), 9);
bitmap.m_size = readSize(get(msg.message(3)), 4);
if (!bitmap.m_size) bitmap.m_size=IWORKSize(); // to do not change result from previous code
const optional<unsigned> &fileRef = readRef(get(msg.message(3)), 6);
diff --git a/src/lib/libetonyek_utils.cpp b/src/lib/libetonyek_utils.cpp
index 1743aa3..9b789c7 100644
--- a/src/lib/libetonyek_utils.cpp
+++ b/src/lib/libetonyek_utils.cpp
@@ -467,7 +467,12 @@ try
unsigned unit=readU8(stream);
unsigned xPixels=readU16(stream, true);
unsigned yPixels=readU16(stream, true);
- if (unit==1) // by inch
+ if (unit==0) // unsure, but this seems more compatible with LibreOffice
+ {
+ factor[0]=1.44*double(xPixels)/72;
+ factor[1]=1.44*double(yPixels)/72;
+ }
+ else if (unit==1) // by inch
{
factor[0]=double(xPixels)/72;
factor[1]=double(yPixels)/72;