LyX Ticket Tracker wrote:
> #7720: Ascii export broken for certain elements
> ---------------------+------------------------------------------------------
>  Reporter:  sanda    |       Owner:  lasgouttes
>      Type:  defect   |      Status:  new       
>  Priority:  normal   |   Milestone:  2.0.2     
> Component:  general  |     Version:  2.0.0     
>  Severity:  normal   |    Keywords:            
> ---------------------+------------------------------------------------------
>  - branches do not work correctly

patch attached. there is no sense to output "[branch: XXX ]" string.
we want only XXX to be in output. will commit unless some objection comes.

>  - bullets do not work correctly

they work, but they are hardcoded into unicode.


however i started to look why insethyperlink forces newline after the inset
in text export and i found hilarious backtrace used to _produce_ .txt output:

#0  lyx::InsetHyperlink::plaintext (this=0x9114750, os=...) at 
insets/InsetHyperlink.cpp:212
#1  0x082929c4 in lyx::writePlaintextParagraph (buf=..., par=..., os=..., 
runparams=..., 
    ref_printed=@0xb5afa773) at output_plaintext.cpp:203
#2  0x0861d57c in lyx::InsetText::toolTipText (this=0x9114488, prefix=..., 
numlines=3, 
    len=60) at insets/InsetText.cpp:883
#3  0x0851d311 in lyx::InsetBranch::addToToc (this=0x9114488, cpit=...)
    at insets/InsetBranch.cpp:306
#4  0x0861e450 in lyx::InsetText::addToToc (this=0x910d550, cdit=...)
    at insets/InsetText.cpp:742
#5  0x0832b129 in lyx::TocBackend::update (this=0x90e2164) at TocBackend.cpp:174
#6  0x080efbd7 in lyx::Buffer::updateBuffer (this=0x90e0810, 


now who would expected that toolTipText has anything to do with export...
unfortunately after changes like r36345 the text export won't work as it
used to be... 
Richard, the work on cleaning the mess around tocString functions is 
considered as finished?

pavel
diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp
index 4888992..83d9e37 100644
--- a/src/insets/InsetBranch.cpp
+++ b/src/insets/InsetBranch.cpp
@@ -216,11 +216,11 @@ int InsetBranch::plaintext(odocstream & os,
        if (!isBranchSelected())
                return 0;
 
-       os << '[' << buffer().B_("branch") << ' ' << params_.branch << ":\n";
-       InsetText::plaintext(os, runparams);
-       os << "\n]";
+       //os << '[' << buffer().B_("branch") << ' ' << params_.branch << ":\n";
+       int len = InsetText::plaintext(os, runparams);
+       //os << "\n]";
 
-       return PLAINTEXT_NEWLINE + 1; // one char on a separate line
+       return len;
 }
 
 

Reply via email to