소스 검색

* Implement option to replace too-long words with asterisks (bug ID 33639)

git-svn-id: trunk@43491 -
michael 5 년 전
부모
커밋
e959e6165e
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      packages/fcl-report/src/fpreport.pp

+ 11 - 1
packages/fcl-report/src/fpreport.pp

@@ -143,7 +143,11 @@ type
             moResetAggregateOnColumn
             );
   TFPReportMemoOptions    = set of TFPReportMemoOption;
-  TFPReportWordOverflow = (woTruncate,woOverflow,woSplit);
+  TFPReportWordOverflow = (woTruncate, // truncate the word
+                           woOverflow, // Allow to overflow
+                           woSplit,    // Split word at max char count that fits length.
+                           woAsterisk  // Replace word with * chars.
+                           );
 
   TFPReportSections    = set of rsPage..rsColumn;
 
@@ -3974,6 +3978,12 @@ begin
             m:=Length(S); // Discard the remainder of the word.
           woSplit:
             m:=Length(S3); // S3 was the longest possible part of the word. Split after
+          woAsterisk:
+            begin
+            w:= lFC.TextWidth('*', Font.Size);
+            S2:=StringOfChar('*',round(MaxW / w));
+            m:=Length(S); // Discard the remainder of the word.
+            end;
        end;
        end;
       FTextLines.Add(s2);