From c0a216c9e999095df86f18d9e25ec4c8f61c75f0 Mon Sep 17 00:00:00 2001 From: Soyoung Kim Date: Mon, 28 Jan 2013 16:45:09 +0900 Subject: [PATCH] Change pkgname to appid Part 3. [Issue#] N/A [Problem] if there is space in appid, widget installation failed. [Cause] N/A [Solution] add function to trim space. [SCMRequest] N/A --- modules/widget_dao/dao/config_parser_data.cpp | 9 +++++++-- .../include/dpl/wrt-dao-ro/config_parser_data.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/widget_dao/dao/config_parser_data.cpp b/modules/widget_dao/dao/config_parser_data.cpp index 2fbd0f6..0e42448 100755 --- a/modules/widget_dao/dao/config_parser_data.cpp +++ b/modules/widget_dao/dao/config_parser_data.cpp @@ -152,7 +152,7 @@ void NormalizeString(DPL::String& str) str = *opt; } -void NormalizeString (DPL::Optional& txt) +void NormalizeString (DPL::Optional& txt, bool isTrimSpace) { if (!!txt) { std::string tmp = DPL::ToUTF8String(*txt); @@ -182,7 +182,7 @@ void NormalizeString (DPL::Optional& txt) if (c[0] == 0x0) { break; } - if (first) { + if (first && !isTrimSpace) { xmlChar space[6] = { 0x20 }; CopyChar(s, space); s += xmlUTF8Size(s); @@ -199,6 +199,11 @@ void NormalizeString (DPL::Optional& txt) } } +void NormalizeAndTrimSpaceString(DPL::OptionalString& txt) +{ + NormalizeString(txt, true); +} + bool ConfigParserData::Param::operator==(const Param& other) const { return name == other.name && value == other.value; diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h b/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h index 1f58b2d..1a227ad 100755 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h @@ -32,9 +32,10 @@ namespace WrtDB { -void NormalizeString(DPL::OptionalString& txt); +void NormalizeString(DPL::OptionalString& txt, bool isTrimSpace = false); void NormalizeString(DPL::String& str); DPL::String GetSingleAttributeValue(const DPL::String value); +void NormalizeAndTrimSpaceString(DPL::OptionalString& txt); class WidgetConfigurationManager; -- 2.34.1