1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/rendering/XCanvas.hpp>
21 #include <vcl/canvastools.hxx>
22 #include <sal/log.hxx>
23 #include "emfpstringformat.hxx"
25 namespace emfplushelper
27 EMFPStringFormat::EMFPStringFormat()
29 , stringFormatFlags(0)
33 , digitSubstitution(0)
46 void EMFPStringFormat::Read(SvMemoryStream
&s
)
48 s
.ReadUInt32(header
).ReadUInt32(stringFormatFlags
).ReadUInt32(language
);
49 s
.ReadUInt32(stringAlignment
).ReadUInt32(lineAlign
).ReadUInt32(digitSubstitution
).ReadUInt32(digitLanguage
);
50 s
.ReadFloat(firstTabOffset
).ReadInt32(hotkeyPrefix
).ReadFloat(leadingMargin
).ReadFloat(trailingMargin
).ReadFloat(tracking
);
51 s
.ReadInt32(trimming
).ReadInt32(tabStopCount
).ReadInt32(rangeCount
);
52 // keep only the last 16 bits of language
55 SAL_WARN_IF((header
>> 12) != 0xdbc01, "drawinglayer", "Invalid header - not 0xdbc01");
56 SAL_INFO("drawinglayer", "EMF+\t string format\nEMF+\theader: 0x" << std::hex
<< (header
>> 12) << " version: 0x" << (header
& 0x1fff) << " StringFormatFlags: 0x" << stringFormatFlags
<< std::dec
<< " Language: " << language
);
57 SAL_INFO("drawinglayer", "EMF+\t StringAlignment: " << stringAlignment
<< " LineAlign: " << lineAlign
<< " DigitSubstitution: " << digitSubstitution
<< " DigitLanguage: " << digitLanguage
);
58 SAL_INFO("drawinglayer", "EMF+\t FirstTabOffset: " << firstTabOffset
<< " HotkeyPrefix: " << hotkeyPrefix
<< " LeadingMargin: " << leadingMargin
<< " TrailingMargin: " << trailingMargin
<< " Tracking: " << tracking
);
59 SAL_INFO("drawinglayer", "EMF+\t Trimming: " << trimming
<< " TabStopCount: " << tabStopCount
<< " RangeCount: " << rangeCount
);
61 SAL_WARN_IF(stringAlignment
, "drawinglayer", "EMF+\t TODO EMFPStringFormat:StringAlignment");
62 SAL_WARN_IF(lineAlign
, "drawinglayer", "EMF+\t TODO EMFPStringFormat:lineAlign");
63 SAL_WARN_IF(digitSubstitution
, "drawinglayer", "EMF+\t TODO EMFPStringFormat:digitSubstitution");
64 SAL_WARN_IF(firstTabOffset
!= 0.0, "drawinglayer", "EMF+\t TODO EMFPStringFormat:firstTabOffset");
65 SAL_WARN_IF(hotkeyPrefix
, "drawinglayer", "EMF+\t TODO EMFPStringFormat:hotkeyPrefix");
66 SAL_WARN_IF(leadingMargin
!= 0.0, "drawinglayer", "EMF+\t TODO EMFPStringFormat:leadingMargin");
67 SAL_WARN_IF(trailingMargin
!= 0.0, "drawinglayer", "EMF+\t TODO EMFPStringFormat:trailingMargin");
68 SAL_WARN_IF(tracking
!= 1.0, "drawinglayer", "EMF+\t TODO EMFPStringFormat:tracking");
69 SAL_WARN_IF(trimming
, "drawinglayer", "EMF+\t TODO EMFPStringFormat:trimming");
70 SAL_WARN_IF(tabStopCount
, "drawinglayer", "EMF+\t TODO EMFPStringFormat:tabStopCount");
71 SAL_WARN_IF(rangeCount
, "drawinglayer", "EMF+\t TODO EMFPStringFormat:StringFormatData");
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */