Resolves tdf#162979 - Avoid oversized online update options
Don't wrap at every semicolon but only after 50 chars Change-Id: I91993d503c574a9c60d390afde159ade73567861 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173552 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins
This commit is contained in:
committed by
Heiko Tietze
parent
7ccfc0277a
commit
74e3f47723
@@ -190,6 +190,25 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
|
|||||||
m_xLastChecked->set_label(aText);
|
m_xLastChecked->set_label(aText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline OUString WrapString(const OUString& aStr)
|
||||||
|
{
|
||||||
|
OUString sResult;
|
||||||
|
OUString sPos;
|
||||||
|
int nPos = 0;
|
||||||
|
for (int i = 0; i < aStr.getLength(); i++)
|
||||||
|
{
|
||||||
|
sPos = aStr.subView(i, 1);
|
||||||
|
sResult += sPos;
|
||||||
|
if ((nPos > 50) && (sPos == ";"))
|
||||||
|
{
|
||||||
|
sResult += "/n";
|
||||||
|
nPos = 0;
|
||||||
|
}
|
||||||
|
nPos++;
|
||||||
|
}
|
||||||
|
return sResult;
|
||||||
|
}
|
||||||
|
|
||||||
void SvxOnlineUpdateTabPage::UpdateUserAgent()
|
void SvxOnlineUpdateTabPage::UpdateUserAgent()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -209,9 +228,7 @@ void SvxOnlineUpdateTabPage::UpdateUserAgent()
|
|||||||
if ( aHeader.First == "User-Agent" )
|
if ( aHeader.First == "User-Agent" )
|
||||||
{
|
{
|
||||||
OUString aText = aHeader.Second;
|
OUString aText = aHeader.Second;
|
||||||
aText = aText.replaceAll(";", ";\n");
|
m_xUserAgentLabel->set_label(WrapString(aText));
|
||||||
aText = aText.replaceAll("(", "\n(");
|
|
||||||
m_xUserAgentLabel->set_label(aText);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user