@@ -476,7 +476,7 @@ TextParagraphType AbstractDocumentImporter::typeForTextCursor(const QTextCursor&
476
476
//
477
477
const QString blockText = _cursor.block ().text ();
478
478
const QString blockTextUppercase = TextHelper::smartToUpper (blockText);
479
- const QString BlockTextWithoutParentheses
479
+ const QString blockTextWithoutParentheses
480
480
= _cursor.block ().text ().remove (kTextInParenthesisChecker );
481
481
482
482
//
@@ -495,8 +495,8 @@ TextParagraphType AbstractDocumentImporter::typeForTextCursor(const QTextCursor&
495
495
|| blockText == TextHelper::smartToUpper (blockText);
496
496
// ... блоки находящиеся в центре
497
497
bool isCentered = !blockFormat.alignment ().testFlag (Qt::AlignRight)
498
- && (((blockFormat.leftMargin () + blockFormat.indent ()) > 0
499
- && (blockFormat.leftMargin () + blockFormat.indent ())
498
+ && (((blockFormat.leftMargin () + blockFormat.indent () + blockFormat. textIndent () ) > 0
499
+ && (blockFormat.leftMargin () + blockFormat.indent () + blockFormat. textIndent () )
500
500
> kLeftMarginDelta + _minLeftMargin)
501
501
|| (blockFormat.alignment ().testFlag (Qt::AlignHCenter))
502
502
|| blockText.startsWith (kOldSchoolCenteringPrefix ));
@@ -507,9 +507,10 @@ TextParagraphType AbstractDocumentImporter::typeForTextCursor(const QTextCursor&
507
507
{
508
508
//
509
509
// Самым первым пробуем определить заголовок сцены
510
- // 1. содержит ключевые сокращения места действия
510
+ // 1. содержит ключевые сокращения места действия или начинается с номера сцены
511
511
//
512
- if (blockTextUppercase.contains (kPlaceContainsChecker )) {
512
+ if (blockTextUppercase.contains (kPlaceContainsChecker )
513
+ || blockTextUppercase.contains (kStartFromNumberChecker )) {
513
514
blockType = TextParagraphType::SceneHeading;
514
515
}
515
516
@@ -537,8 +538,8 @@ TextParagraphType AbstractDocumentImporter::typeForTextCursor(const QTextCursor&
537
538
// 1. В верхнем регистре
538
539
//
539
540
else if ((textIsUppercase
540
- || BlockTextWithoutParentheses
541
- == TextHelper::smartToUpper (BlockTextWithoutParentheses ))
541
+ || blockTextWithoutParentheses
542
+ == TextHelper::smartToUpper (blockTextWithoutParentheses ))
542
543
&& _lastBlockType != TextParagraphType::Character) {
543
544
blockType = TextParagraphType::Character;
544
545
}
0 commit comments