33#include <rtl/character.hxx>
34#include <rtl/strbuf.hxx>
35#include <rtl/string.hxx>
54 static const int wsize[32] =
56 1, 4, 4, 4, 4, 4, 4, 42,
57 48, 4, 4, 4, 4, 1, 4, 4,
58 4, 4, 4, 4, 4, 4, 12, 5,
59 3, 3, 123, 4, 32, 4, 2, 2
122 0xB7A9, 0xB6A9, 0xD1C1, 0xAE81, 0xA1A2, 0x8B71, 0xC9A1
126 0x4CC8, 0x4BE4, 0x525A, 0x48D8, 0x45AB, 0x4270, 0x50B4
128const char eng_week[] = {
"SunMonTueWedThuFriSat" };
129const char eng_mon[] = {
"JanFebMarAprMayJunJulAugSepOctNovDec" };
132 "January",
"February",
"March",
"April",
"May",
"June",
"July",
133 "August",
"September",
"October",
"November",
"December"
137 "Sunday",
"Monday",
"Tuesday",
"Wednesday",
138 "Thursday",
"Friday",
"Saturday"
148 bool is_pm, add_zero;
154 for (; *fmt && (ret.size() <
DATE_SIZE); fmt++)
156 form = add_zero ?
"%02d" :
"%d";
180 static_assert((std::size(
eng_mon) - 1) / 3 == 12);
190 strncat(cbuf,
en_mon[
nIndex],
sizeof(cbuf) - strlen(cbuf) - 1);
232 static_assert((std::size(
eng_week) - 1) / 3 == 7);
242 strncat(cbuf,
en_week[
nIndex],
sizeof(cbuf) - strlen(cbuf) - 1);
246 ret.push_back(0xB5A1);
247 ret.push_back(is_pm ? 0xD281 : 0xB8E5);
250 strncat(cbuf, is_pm ?
"p.m." :
"a.m.",
sizeof(cbuf) - strlen(cbuf) - 1);
253 strncat(cbuf, is_pm ?
"P.M." :
"A.M.",
sizeof(cbuf) - strlen(cbuf) - 1);
259 mkcurfilename(cbuf, *fmt);
260 for (
i = 0; cbuf[
i] != 0 && slen > 1;
i++)
262 if (cbuf[
i] & 0x80 && cbuf[
i + 1] != 0)
264 *
d++ = (cbuf[
i] << 8) | cbuf[
i + 1];
286 if (*fmt ==
'\\' && *++fmt == 0)
292 for (
i = 0; 0 != cbuf[
i];
i++)
294 ret.push_back(*(cbuf +
i));
372 , follow_block_size(0)
431#define OL_HANGL_JASO 0
432#define OL_HANGL_KANATA 1
436 static const unsigned char han_init[] =
437 { 0x88, 0x90, 0x94, 0x9c, 0xa0, 0xa4, 0xac, 0xb4, 0xb8, 0xc0, 0xc4, 0xc8, 0xcc, 0xd0 };
438 static const unsigned char jung[] = { 3, 5, 7, 11, 13, 19, 20, 26, 27, 29, 30 };
439 static const unsigned char jung2[] = { 3, 7, 13, 20, 27, 29, 30 };
448 hh = (han_init[num] << 8) |
'A';
450 hh = (jung[num - 14] << 5) | 0x8401;
455 hh = (han_init[num] << 8) |
'a';
461 hh = (han_init[num] << 8) | (jung2[j] << 5) | 1;
473 0x2f18, 0x2f12, 0x2f08, 0x2f02, 0x2f06, 0x2f00, 0x2043, 0x0000
476 0x2f18, 0x2f12, 0x2f06, 0x2f00, 0x2f36, 0x2f30, 0x2043, 0x0000
479 0x2f26, 0x2f20, 0x2f06, 0x2f00, 0x2f16, 0x2f10, 0x2043, 0x0000
482 0x2f18, 0x2f16, 0x2f12, 0x2f10, 0x2f06, 0x2f00, 0x2043, 0x0000
485 0xAC61, 0xB677, 0xB861, 0xB8F7, 0xB781, 0x0000, 0x0000, 0x0000
498 U_ROM = 0x01, L_ROM = 0x02, U_ENG = 0x04, L_ENG = 0x08,
499 HAN = 0x10, NUM = 0x20, L_BR = 0x40, R_BR = 0x80
504 U_ROM, HAN, NUM, HAN | R_BR, L_BR | NUM | R_BR,
505 L_BR | HAN | R_BR, L_ROM | R_BR
508 U_ROM, U_ENG, NUM, L_ENG | R_BR, L_BR | NUM | R_BR,
509 L_BR | L_ENG | R_BR, L_ROM | R_BR
512 NUM, HAN, L_BR | NUM | R_BR, L_BR | HAN | R_BR, NUM |
513 R_BR, HAN | R_BR, L_ENG
525 auto const numbuf = OString::number(num);
527 hstr += numbuf.length;
529 else if (fmt & (U_ROM | L_ROM))
537 *ptr = sal::static_int_cast<char>(
538 rtl::toAsciiUpperCase(
static_cast<unsigned char>(*ptr)));
547 num = (num - 1) % 26;
549 *hstr++ = sal::static_int_cast<hchar>(
'A' + num);
550 else if (fmt & L_ENG)
551 *hstr++ = sal::static_int_cast<hchar>(
'a' + num);
555 *hstr++ = (fmt & R_BR) ?
')' :
'.';
582 for (
unsigned int i = 0;
i <=
level; ++
i)
588 buf.append(OString::number(levelnum));
643 *ptr = sal::static_int_cast<char>(rtl::toAsciiUpperCase(
static_cast<unsigned char>(*ptr)));
681 for (j = 0; j <=
level; j++)
684 buf.append(OString::number(levelnum));
689 l += buf.getLength();
hchar user_shape[MAX_OUTLINE_LEVEL]
shape of level
OUString GetUnicode() const
unsigned short kind
kind of numbering format
unsigned char level
level of number, Ex) The level of 1.3.2.4 is four
unsigned short number[MAX_OUTLINE_LEVEL]
value of level
hchar deco[MAX_OUTLINE_LEVEL][2]
decoration character for the level type
const hchar defaultform[]
const char *const en_week[]
static const hchar * GetOutlineStyleChars(int style)
static hchar olHanglJaso(int num, int type)
const char *const en_mon[]
static void getOutlineNumStr(int style, int level, int num, hchar *hstr)
#define MAX_OUTLINE_LEVEL
OUString hstr2OUString(hchar const *hstr)
static char buffer[FONTNAMELEN]
void str2hstr(const char *c, hchar *i)
Transfer 8bit string to 16bit string used internally in hwp.
void num2roman(int num, char *buf)
Transfer number to roman character.
::std::basic_string< hchar > hchar_string
char16_t hchar
size of hunit is 4 since hwp96 version
#define SAL_N_ELEMENTS(arr)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
int sprintf(char(&s)[N], char const *format, T &&... arguments)
virtual ~Bookmark() override
short date[6]
year/month/week/day/hour/minute
This object is for floating object like table, image, line and so on.
virtual ~FieldCode() override
The HBox class is the base class for all date classes in hwp document.
HBox(hchar hch)
Construct a HBox object with parameter hch.
virtual ~Hidden() override
static hchar_string GetString()
virtual ~Picture() override
virtual ~SkipData() override
virtual ~TxtBox() override