Changeset 8a9cc7e in tol
- Timestamp:
- Nov 9, 2011, 4:39:23 PM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 41e86a8
- Parents:
- 5063abb
- File:
-
- 1 edited
-
tol/bparser/fil.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/bparser/fil.cpp
r5063abb r8a9cc7e 605 605 BText BFilter::Transform(const BText& original) const 606 606 { 607 error_ = false; 608 errorMsg_ = ""; 609 BText expression = original; 610 BTextBlock block; 611 GetBlocks(expression, block); 612 expression = ""; 613 BText cleaned = ""; 614 for(BInt k = 0; k<block.Size(); k++) { 615 BInt blockClass=ClassifyBlock(block[k].text.Buffer()); 616 617 if((blockClass==NormalBlock)) { 618 cleaned += block[k].text + " "; 619 } 620 621 if(blockClass==QuotesBlock) { 622 Clean(cleaned); 623 CleanQuotes(block[k].text); 624 expression += cleaned + " " + block[k].text + " "; 625 cleaned = ""; 626 } 627 } 628 629 if(cleaned.HasName()) { 630 Clean(cleaned); 631 expression += cleaned; 632 } 633 634 while(expression.Length() && strchr(" \t\n;",expression.Last())) { 635 expression.PutLength(expression.Length()-1); 636 } 637 638 if(error_) return errorMsg_; 639 else return expression; 607 error_ = false; 608 errorMsg_ = ""; 609 BText expression = original; 610 BTextBlock block; 611 GetBlocks(expression, block); 612 expression = ""; 613 BText cleaned = ""; 614 for(BInt k = 0; k<block.Size(); k++) 615 { 616 BInt blockClass=ClassifyBlock(block[k].text.Buffer()); 617 if((blockClass==NormalBlock)) 618 { 619 cleaned += block[k].text + " "; 620 } 621 if(blockClass==QuotesBlock) 622 { 623 Clean(cleaned); 624 CleanQuotes(block[k].text); 625 expression += cleaned + " " + block[k].text + " "; 626 cleaned = ""; 627 } 628 } 629 if(cleaned.HasName()) 630 { 631 Clean(cleaned); 632 expression += cleaned; 633 } 634 635 while(expression.Length() && strchr(" \t\n;",expression.Last())) 636 { 637 expression.PutLength(expression.Length()-1); 638 } 639 if(error_) { return errorMsg_; } 640 else 641 { 642 BText s20(expression,0,20); 643 s20.Compact(); 644 //Std(BText("BFilter::Transform 1 : '")<<s20<<"'"); 645 if(s20.BeginWith("#Embed")) 646 { 647 expression = BText("Write ( \" \" ) ; ") << expression; 648 }; 649 return expression; 650 } 640 651 } 641 652
Note: See TracChangeset
for help on using the changeset viewer.
