~ubuntu-branches/debian/sid/texstudio/sid

« back to all changes in this revision

Viewing changes to latexdocument.cpp

  • Committer: Package Import Robot
  • Author(s): Tom Jampen
  • Date: 2014-09-10 07:36:27 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140910073627-25emtb7omxdfjuvl
Tags: 2.8.4+debian-1
* Merging upstream version 2.8.4+debian.
* Regenerating 01-use-libhunspell.patch.
* Updating 04-no-qt-translations.patch to also exclude qt_pl.qm.
* Regenerating 05-use-libsynctex.patch.
* Updating package description to include new polish translations.
* Switching to default xz compression level in rules.
* Rebuilding upstream tarball without:
  - conflicting debian directory
  - unused hunspell directory
  - unused include_win32 directory
  - unused include_win32_qt5 directory
  - unused qt translations
  - unused dictionary and thesaurus files
  - unused TexTablet directory
  - unused poppler-data directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
548
548
                }
549
549
                                completerNeedsUpdate=true;
550
550
                                QRegExp rx("^\\s*(\\[.+\\])?");
551
 
                                int options=arg.toInt();
 
551
                int options=0;
 
552
                if(arg.startsWith('[')){
 
553
                    arg=LatexParser::removeOptionBrackets(arg);
 
554
                    options=arg.toInt();
 
555
                    // limit options !!!
 
556
                    if(options>9 || options<0)
 
557
                        options=0;
 
558
                }
 
559
 
552
560
                                int def=0;
553
561
                                if(rx.indexIn(remainder)>-1){
554
562
                                        if(!rx.cap(1).isEmpty())
558
566
                if(!removedUserCommands.removeAll(name)){
559
567
                    addedUserCommands << name;
560
568
                }
561
 
                                if(def==1){
 
569
                // why twice ??
 
570
                /*if(def==1){
562
571
                                        QString helper=name;
563
572
                                        for (int j=0; j<options; j++) {
564
573
                                                if (j==1)
568
577
                                        }
569
578
                                        mUserCommandList.insert(line(i).handle(),helper);
570
579
                                        
571
 
                                }
 
580
                }*/
572
581
                                for (int j=0; j<options; j++) {
573
582
                                        if (j==0) {
574
583
                                                if(def==0)
628
637
                        static const QStringList envTokens = QStringList() << "\\newenvironment" << "\\renewenvironment";
629
638
                        if (envTokens.contains(cmd)) {
630
639
                                completerNeedsUpdate=true;
631
 
                                int options=arg.toInt(); //returns 0 if conversion fails
 
640
                int options=0;
 
641
                if(arg.startsWith('[')){
 
642
                    arg=LatexParser::removeOptionBrackets(arg);
 
643
                    options=arg.toInt(); //returns 0 if conversion fails
 
644
                    if(options>9 || options<0)
 
645
                        options=0;
 
646
                }
632
647
                                name.append("}");
633
648
                                mUserCommandList.insert(line(i).handle(),"\\end{"+name);
634
649
                                QStringList lst;
797
812
                                }else{
798
813
                                        newBlock=new StructureEntry(this, StructureEntry::SE_BLOCK);
799
814
                                }
800
 
                                newBlock->title=arg;
 
815
                newBlock->title=LatexParser::removeOptionBrackets(arg);
801
816
                                newBlock->setLine(line(i).handle(), i);
802
817
                                newBlock->parent=blockList;
803
818
                                iter_block.insert(newBlock);
833
848
                        if (latexParser.possibleCommands["%import"].contains(cmd) && !isDefinitionArgument(name)) {
834
849
                                StructureEntry *newInclude=new StructureEntry(this, StructureEntry::SE_INCLUDE);
835
850
                                newInclude->level = parent && !parent->indentIncludesInStructure ? 0 : latexParser.structureDepth() - 1;
836
 
                QFileInfo fi(name,arg);
 
851
                QFileInfo fi(name,LatexParser::removeOptionBrackets(arg));
837
852
                QString file = fi.filePath();
838
853
                                newInclude->title = file;
839
854
                QString fname=findFileName(file);
1141
1156
                        deleteVisitedDocs=true;
1142
1157
                }
1143
1158
        foreach(LatexDocument *elem,parent->getDocuments()){ // check children
1144
 
                        if(elem!=master && elem->masterDocument!=master) continue;
 
1159
               //if(elem!=master && elem->masterDocument!=master) continue; disabled; if a doc is included in many master documents it needs to be known in all of them
1145
1160
                        if(visitedDocs && !visitedDocs->contains(elem)){
1146
1161
                                listOfDocs << elem;
1147
1162
                                visitedDocs->insert(elem);