[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] trivial patch: don't use deprecated GetPrintableName()
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] trivial patch: don't use deprecated GetPrintableName() |
Date: |
Sat, 10 May 2008 22:30:02 +0200 |
Following up to my own recent post:
VZ> Here is a really trivial patch which avoids a warning about using a
VZ> deprecated function:
VZ>
VZ> --- upstream/view_ex.cpp 2008-04-09 22:00:11.000000000 +0200
VZ> +++ modified/view_ex.cpp 2008-05-10 17:36:14.000000000 +0200
VZ> @@ -179,8 +179,6 @@
VZ> std::string ViewEx::base_filename() const
VZ> {
VZ> - wxString z;
VZ> - GetDocument()->GetPrintableName(z);
VZ> - std::string t(z);
VZ> - if(0 == t.size())
VZ> + std::string t(GetDocument()->GetUserReadableName());
VZ> + if(t.empty())
VZ> {
VZ> t = "Anonymous";
I'm sorry, I've somehow missed the fact that exactly the same problem
arises in IllustrationView class, so here is an updated patch which fixes
it in both places:
--- old/view_ex.cpp 2008-03-25 12:54:28 +0000
+++ new/view_ex.cpp 2008-05-10 15:32:22 +0000
@@ -178,10 +178,8 @@
std::string ViewEx::base_filename() const
{
- wxString z;
- GetDocument()->GetPrintableName(z);
- std::string t(z);
- if(0 == t.size())
+ std::string t(GetDocument()->GetUserReadableName());
+ if(t.empty())
{
t = "Anonymous";
}
--- old/illustration_view.cpp 2008-03-27 16:08:16 +0000
+++ new/illustration_view.cpp 2008-05-10 20:17:22 +0000
@@ -341,9 +341,7 @@
{
LMI_ASSERT(ledger_values_.get());
- wxString z;
- document().GetPrintableName(z);
- std::string filename(z.c_str());
+ std::string filename(document().GetUserReadableName());
std::string pdf_out_file = write_ledger_as_pdf(*ledger_values_, filename);
file_command()(pdf_out_file, action);
And I also should have probably mentioned in my previous email that I'm
going to submit a slightly less trivial patch fixing a similar problem with
MakeDefaultName() very soon so if you prefer to apply both of them at once
you should wait for it.
Thanks,
VZ
- [lmi] trivial patch: don't use deprecated GetPrintableName(), Vadim Zeitlin, 2008/05/10
- Re: [lmi] trivial patch: don't use deprecated GetPrintableName(),
Vadim Zeitlin <=
- Re: [lmi] trivial patch: don't use deprecated GetPrintableName(), Greg Chicares, 2008/05/10
- [lmi] a less trivial patch: don't use deprecated MakeDefaultName() + refactoring, Vadim Zeitlin, 2008/05/11
- Re: [lmi] a less trivial patch: don't use deprecated MakeDefaultName() + refactoring, Greg Chicares, 2008/05/13
- Re: [lmi] a less trivial patch: don't use deprecated MakeDefaultName() + refactoring, Greg Chicares, 2008/05/21
- Re[2]: [lmi] a less trivial patch: don't use deprecated MakeDefaultName() + refactoring, Vadim Zeitlin, 2008/05/21
- Re[2]: [lmi] a less trivial patch: don't use deprecated MakeDefaultName() + refactoring, Vadim Zeitlin, 2008/05/25
- Re: [lmi] a less trivial patch: don't use deprecated MakeDefaultName() + refactoring, Greg Chicares, 2008/05/26