summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/cmdlineargs.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index e67f204866e9..490bf183de33 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -287,9 +287,12 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
{
m_bEmpty = false;
OUString oArg;
- bool bDeprecated = !aArg.startsWith("--", &oArg)
- && aArg.startsWith("-", &oArg) && aArg.getLength() > 2;
- // -h, -?, -n, -o, -p are still valid
+ OUString oDeprecatedArg;
+ if (!aArg.startsWith("--", &oArg) && aArg.startsWith("-", &oArg)
+ && aArg.getLength() > 2) // -h, -?, -n, -o, -p are still valid
+ {
+ oDeprecatedArg = aArg; // save here, since aArg can change later
+ }
OUString rest;
if ( oArg == "minimized" )
@@ -423,7 +426,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
*/
else if ( aArg.startsWith("-psn") )
{
- bDeprecated = false;
+ oDeprecatedArg.clear();
}
#endif
#if HAVE_FEATURE_MACOSX_SANDBOX
@@ -439,7 +442,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
*/
else if ( oArg == "Embedding" )
{
- bDeprecated = false;
+ oDeprecatedArg.clear();
}
#endif
else if ( oArg.startsWith("infilter=", &rest))
@@ -622,7 +625,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
{
m_unknown = aArg;
}
- bDeprecated = false;
+ oDeprecatedArg.clear();
}
else
{
@@ -673,9 +676,9 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
}
}
- if (bDeprecated)
+ if (!oDeprecatedArg.isEmpty())
{
- OString sArg(OUStringToOString(aArg, osl_getThreadTextEncoding()));
+ OString sArg(OUStringToOString(oDeprecatedArg, osl_getThreadTextEncoding()));
fprintf(stderr, "Warning: %s is deprecated. Use -%s instead.\n", sArg.getStr(), sArg.getStr());
}
}