diff options
Diffstat (limited to 'desktop/source/app/cmdlineargs.cxx')
-rw-r--r-- | desktop/source/app/cmdlineargs.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index bbe3bcbeb5ee..a1377168abf8 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -288,9 +288,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" ) @@ -424,7 +427,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) */ else if ( aArg.startsWith("-psn") ) { - bDeprecated = false; + oDeprecatedArg.clear(); } #endif #if HAVE_FEATURE_MACOSX_SANDBOX @@ -440,7 +443,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) */ else if ( oArg == "Embedding" ) { - bDeprecated = false; + oDeprecatedArg.clear(); } #endif else if ( oArg.startsWith("infilter=", &rest)) @@ -623,7 +626,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) { m_unknown = aArg; } - bDeprecated = false; + oDeprecatedArg.clear(); } else { @@ -674,9 +677,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()); } } |