[Libreoffice-commits] core.git: 2 commits - helpcompiler/source vcl/source
Caolán McNamara
caolanm at redhat.com
Mon Feb 2 07:02:14 PST 2015
helpcompiler/source/HelpCompiler.cxx | 30 +++++++++++++++++++++++++-----
vcl/source/window/window.cxx | 3 +--
2 files changed, 26 insertions(+), 7 deletions(-)
New commits:
commit b5d82887bb6726b674b857dc94a3b1513879c82e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 2 15:01:21 2015 +0000
don't need this case
Change-Id: Ib4445031b62248207e3eee257e2b71c446aa5b9d
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index cc49cab..15e3522 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3212,7 +3212,6 @@ const Wallpaper& Window::GetDisplayBackground() const
const OUString& Window::GetHelpText() const
{
-
OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
bool bStrHelpId = !aStrHelpId.isEmpty();
@@ -3223,7 +3222,7 @@ const OUString& Window::GetHelpText() const
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- ((vcl::Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
+ mpWindowImpl->maHelpText = pHelp->GetHelpText(aStrHelpId, this);
mpWindowImpl->mbHelpTextDynamic = false;
}
}
commit cc464d1a94172ca28e9d962fa6e1ffadabc1dc79
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 2 14:49:15 2015 +0000
Resolves: fdo#88970 fix Incorrect Extended-tips with dodgy ahelp tags
ahelp puts the tip on the previous bookmarks with hid branches
but has a scattergun effect if those previous bookmarks have
nothing to do with the current element being described.
So take the hid attribute of the ahelp and if its hid="." use
the current set of bookmarks as the context otherwise believe
it and apply the tip just to the stated hid
Change-Id: I00648daadf5673e1abc96f222a4526959f1f7d7a
diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx
index 80c1bc6..ccc324f 100644
--- a/helpcompiler/source/HelpCompiler.cxx
+++ b/helpcompiler/source/HelpCompiler.cxx
@@ -398,16 +398,36 @@ void myparser::traverse( xmlNodePtr parentNode )
}
else if (!strcmp(reinterpret_cast<const char*>(test->name), "ahelp"))
{
+ //tool-tip
std::string text = dump(test);
std::replace(text.begin(), text.end(), '\n', ' ');
trim(text);
- std::string name;
- HashSet::const_iterator aEnd = extendedHelpText.end();
- for (HashSet::const_iterator iter = extendedHelpText.begin(); iter != aEnd; ++iter)
+ //tool-tip target
+ std::string hidstr("."); //. == previous seen hid bookmarks
+ xmlChar *hid = xmlGetProp(test, reinterpret_cast<const xmlChar*>("hid"));
+ if (hid)
{
- name = *iter;
- (*helptexts)[name] = text;
+ hidstr = std::string(reinterpret_cast<char*>(hid));
+ xmlFree (hid);
+ }
+
+ if (hidstr != "." && !hidstr.empty()) //simple case of explicitly named target
+ {
+ assert(!hidstr.empty());
+ (*helptexts)[hidstr] = text;
+ }
+ else //apply to list of "current" hids determined by recent bookmarks that have hid in their branch
+ {
+ //TODO: make these asserts and flush out all our broken help ids
+ SAL_WARN_IF(hidstr.empty(), "helpcompiler", "hid='' for text:" << text);
+ SAL_WARN_IF(!hidstr.empty() && extendedHelpText.empty(), "helpcompiler", "hid='.' with no hid bookmark branches for text:" << text);
+ HashSet::const_iterator aEnd = extendedHelpText.end();
+ for (HashSet::const_iterator iter = extendedHelpText.begin(); iter != aEnd; ++iter)
+ {
+ std::string name = *iter;
+ (*helptexts)[name] = text;
+ }
}
extendedHelpText.clear();
}
More information about the Libreoffice-commits
mailing list