diff --git a/src/ctemplate/template_dictionary.h.in b/src/ctemplate/template_dictionary.h.in index 8612f82..ca232e7 100644 --- a/src/ctemplate/template_dictionary.h.in +++ b/src/ctemplate/template_dictionary.h.in @@ -231,10 +231,6 @@ class @ac_windows_dllexport@ TemplateDictionary : public TemplateDictionaryInter __attribute__((__format__ (__printf__, 4, 5))) #endif ; // starts at 4 because of implicit 1st arg 'this' - void SetEscapedValueAndShowSection(const TemplateString variable, - const TemplateString value, - const TemplateModifier& escfn, - const TemplateString section_name); private: diff --git a/src/template_dictionary.cc b/src/template_dictionary.cc index 78864d2..a243d8d 100644 --- a/src/template_dictionary.cc +++ b/src/template_dictionary.cc @@ -616,16 +616,6 @@ void TemplateDictionary::SetValueAndShowSection(const TemplateString variable, sub_dict->SetValue(variable, value); } -void TemplateDictionary::SetEscapedValueAndShowSection( - const TemplateString variable, const TemplateString value, - const TemplateModifier& escfn, const TemplateString section_name) { - string escaped_string(escfn(value.ptr_, value.length_)); - if (escaped_string.empty()) // no value: the do-nothing case - return; - TemplateDictionary* sub_dict = AddSectionDictionary(section_name); - sub_dict->SetValue(variable, escaped_string); -} - // ---------------------------------------------------------------------- // TemplateDictionary::AddIncludeDictionary() // This is much like AddSectionDictionary(). One major difference diff --git a/src/tests/template_dictionary_unittest.cc b/src/tests/template_dictionary_unittest.cc index 07c143d..f524a21 100644 --- a/src/tests/template_dictionary_unittest.cc +++ b/src/tests/template_dictionary_unittest.cc @@ -481,22 +481,9 @@ TEST(TemplateDictionary, SetValueAndShowSection) { dict.SetValueAndShowSection("NOTINSEC", "", "SEC2"); dict.SetValueAndShowSection("NOTINSEC2", NULL, "SEC3"); - dict.SetEscapedValueAndShowSection("EINSEC", "a & b", - GOOGLE_NAMESPACE::html_escape, - "SEC4"); - dict.SetEscapedValueAndShowSection("EINSEC2", "a beautiful poem", - FooEscaper(), - "SEC5"); - dict.SetEscapedValueAndShowSection("NOTEINSEC", "a long string", - NullEscaper(), - "SEC6"); - EXPECT_FALSE(peer.IsHiddenSection("SEC1")); EXPECT_TRUE(peer.IsHiddenSection("SEC2")); EXPECT_TRUE(peer.IsHiddenSection("SEC3")); - EXPECT_FALSE(peer.IsHiddenSection("SEC4")); - EXPECT_FALSE(peer.IsHiddenSection("SEC5")); - EXPECT_TRUE(peer.IsHiddenSection("SEC6")); // Again, we don't get subdicts, so we have to dump to check values string dump; @@ -514,14 +501,6 @@ TEST(TemplateDictionary, SetValueAndShowSection) { " dictionary 'test_SetValueAndShowSection/SEC1#1' {\n" " INSEC: >bar<\n" " }\n" - " section SEC4 (dict 1 of 1) -->\n" - " dictionary 'test_SetValueAndShowSection/SEC4#1' {\n" - " EINSEC: >a & b<\n" - " }\n" - " section SEC5 (dict 1 of 1) -->\n" - " dictionary 'test_SetValueAndShowSection/SEC5#1' {\n" - " EINSEC2: >foo<\n" - " }\n" "}\n"); EXPECT_STREQ(dump.c_str(), expected); } diff --git a/src/tests/template_regtest.cc b/src/tests/template_regtest.cc index 9c55254..bc1297f 100644 --- a/src/tests/template_regtest.cc +++ b/src/tests/template_regtest.cc @@ -306,9 +306,9 @@ static TemplateDictionary* MakeDict1() { dict->SetEscapedValue("GOTO_MESSAGE", "print \"Go home\"", GOOGLE_NAMESPACE::javascript_escape); - dict->SetEscapedValueAndShowSection("UPDATE", "monday & tuesday", - GOOGLE_NAMESPACE::html_escape, - "UPDATE_SECTION"); + dict->SetEscapedValue("UPDATE", "monday & tuesday", + GOOGLE_NAMESPACE::html_escape); + dict->ShowSection("UPDATE_SECTION"); dict->SetValue("ALIGNMENT", "\"right\""); // all results sections see this for (int i = 0; i < 3; ++i) { // we'll do three results